Hi to all.
I need to import a thirdy party products catalogue.
I did not have This catalogue yet...but thirdy party told me it will contain product code, ean code , product image.
I read about BLOB field ...so i will prepare a progress table (Versione 10.2.b i have) with a Blob field.
I read about COPY-LOB statement and i read examples about it.
My question is ...could be correct a 4GL code like this to import data in a Progress table ??
Or as anyone any good example of IMPORT of a catalogue file with images ???
I have really no experience about it...
I understood before need to use a MEMPTR variable and then i can copy it in a BLOB field DB...
Regards in advance for any help.
Thanks.
Edit: Added CODE tags.
I need to import a thirdy party products catalogue.
I did not have This catalogue yet...but thirdy party told me it will contain product code, ean code , product image.
I read about BLOB field ...so i will prepare a progress table (Versione 10.2.b i have) with a Blob field.
I read about COPY-LOB statement and i read examples about it.
My question is ...could be correct a 4GL code like this to import data in a Progress table ??
Or as anyone any good example of IMPORT of a catalogue file with images ???
I have really no experience about it...
I understood before need to use a MEMPTR variable and then i can copy it in a BLOB field DB...
Code:
DEF VAR w-product AS CHAR.
DEF VAR w-eancode AS CHAR.
DEF VAR w-memptr AS MEMPRT NO-UNDO. /* I imagine to use a MEMPRT to import an image..*/
SET-SIZE(w-memptr) = 100. /* i read i have to set size of memprt variable */
INPUT FROM (Filename)
REPEAT:
IMPORT UNFORMATTED w-product
w-eancode
w-memptr.
FIND FIRST table WHERE table.product = w-product NO-ERROR.
IF AVAIL table THEN ASSIGN table.product = w-product
table.eancode = w-eancode
table.image = w-memprt.
/* i read i could also to do an ASSIGN instead of COPY-LOB*/
END.
SET-SIZE(w-memprt) = 0 /* i read i need to clear memory */
INPUT CLOSE.
Regards in advance for any help.
Thanks.
Edit: Added CODE tags.
Last edited by a moderator: