Display BYTE in HTML generated by 4gl cgi
Posted in 1999
A 4GL 6.00 CGI program could display query results as HTML but couldn't output a BYTE (JPEG) column: UNLOAD produced a hex dump and REPORT just wrote 'BYTE value'. Suggested answers: write an ESQL/C routine callable from 4GL to write the blob to a local file (examples in the ESQL manual/demo code; c4gl can compile simple ESQL/C), use the Informix or Marco Greco's 4GL webkit from the IIUG archives, which can output a blob directly, or simply DEFINE the variable as BYTE and LOCATE it IN FILE under the web root before SELECTing into it. No confirmation from the original poster.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Migration, Import/Export & Data Conversion
I've written a cgi program (INFORMIX-4GL Version 6.00.UE3) that works very well at querying and displaying data from an IDS database to an HTML page. Problem: I now have a need to display a BYTE value (JPG). I realize the IMG tag needs a URI, so I am attempting to save the BYTE to a temp file, then display that. UNLOAD give a HEX dump that is of no use, and REPORT simply writes 'BYTE value' into the file, also of no use. I know the byte value is O.K., as I am able to use DELPHI to store and retrieve the value. Aside from buying the Universal server options, is there a way to display a BYTE in a browser? Has anyone done this? ===== Sky Southwell Data Management Maricopa County Attorney's Office Phoenix, AZ 85003 southwel@mcao.maricopa.gov Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
Sky, 4GL has no facility to easily extract a BYTE. You must write an ESQL/C module, callable from 4GL, that will set up the database to write the BLOB into a local file. There are examples of how to do this in the ESQL manual and the sample code directory. 4GL 6.00 will compile MOST straightforward ESQL/C so you may be able to use the c4gl compiler to do this if you do not have ESQL/C. If you use RDS and do not have ESQL/C you are out of luck. If you do you just link the function into a custom runner. Art S. Kagel southwel@my-deja.com wrote: > > I've written a cgi program (INFORMIX-4GL Version > 6.00.UE3) that works very well at querying and > displaying data from an IDS database to an HTML > page. Problem: I now have a need to display a > BYTE value (JPG). I realize the IMG tag needs a > URI, so I am attempting to save the BYTE to a temp > file, then display that. UNLOAD give a HEX dump > that is of no use, and REPORT simply writes 'BYTE > value' into the file, also of no use. > > I know the byte value is O.K., as I am able to use > DELPHI to store and retrieve the value. > > Aside from buying the Universal server options, is > there a way to display a BYTE in a browser? Has > anyone done this? > > ===== > Sky Southwell > Data Management > Maricopa County Attorney's Office > Phoenix, AZ 85003 > southwel@mcao.maricopa.gov > > Sent via Deja.com http://www.deja.com/ > Share what you know. Learn what you don't.
You are quite right Art, 4gl alone is not enough. However the ifmx 4gl webkit (adn mine too, for that matter) has a facility that outputs a blob var irrespective of its location. So maybe Sky wants to have a look at the IIUG software archives? -- Ciao, Marco ______________________________________________________________________________ Marco Greco <marco@informix.com> Standard disclaimers apply! Informix faq http://www.iiug.org/techinfo/faq/informix.htm 4glworks http://www.ctonline.it/~marcog Informix on Linux http://www.ctonline.it/~marcog/ifmxlinux.htm
In article <7r3ocf$5f$1@nnrp1.deja.com>, southwel@my-deja.com wrote: > I've written a cgi program (INFORMIX-4GL Version > 6.00.UE3) that works very well at querying and > displaying data from an IDS database to an HTML > page. Problem: I now have a need to display a > BYTE value (JPG). I realize the IMG tag needs a > URI, so I am attempting to save the BYTE to a temp > file, then display that. UNLOAD give a HEX dump > that is of no use, and REPORT simply writes 'BYTE > value' into the file, also of no use. Try to use LOCATE statement with named file for you byte variable. It should be something like this: define pic byte define file_name char(256) define cmd char(256) let file_name = "/wwwroot/images/1.gif" locate pic in file file_name initialize pic to NULL select picture into pic from images where image_name = "1.gif" -- ddv > > I know the byte value is O.K., as I am able to use > DELPHI to store and retrieve the value. > > Aside from buying the Universal server options, is > there a way to display a BYTE in a browser? Has > anyone done this? > > ===== > Sky Southwell > Data Management > Maricopa County Attorney's Office > Phoenix, AZ 85003 > southwel@mcao.maricopa.gov > > Sent via Deja.com http://www.deja.com/ > Share what you know. Learn what you don't. > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
In article <7r3ocf$5f$1@nnrp1.deja.com>, southwel@my-deja.com wrote: > I've written a cgi program (INFORMIX-4GL Version > 6.00.UE3) that works very well at querying and > displaying data from an IDS database to an HTML > page. Problem: I now have a need to display a > BYTE value (JPG). I realize the IMG tag needs a > URI, so I am attempting to save the BYTE to a temp > file, then display that. UNLOAD give a HEX dump > that is of no use, and REPORT simply writes 'BYTE > value' into the file, also of no use. Try to use LOCATE statement with named file for you byte variable. It should be something like this: define pic byte define file_name char(256) define cmd char(256) let file_name = "/wwwroot/images/1.gif" locate pic in file file_name initialize pic to NULL select picture into pic from images where image_name = "1.gif" -- ddv > > I know the byte value is O.K., as I am able to use > DELPHI to store and retrieve the value. > > Aside from buying the Universal server options, is > there a way to display a BYTE in a browser? Has > anyone done this? > > ===== > Sky Southwell > Data Management > Maricopa County Attorney's Office > Phoenix, AZ 85003 > southwel@mcao.maricopa.gov > > Sent via Deja.com http://www.deja.com/ > Share what you know. Learn what you don't. > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
In article <7r3ocf$5f$1@nnrp1.deja.com>, southwel@my-deja.com wrote: > I've written a cgi program (INFORMIX-4GL Version > 6.00.UE3) that works very well at querying and > displaying data from an IDS database to an HTML > page. Problem: I now have a need to display a > BYTE value (JPG). I realize the IMG tag needs a > URI, so I am attempting to save the BYTE to a temp > file, then display that. UNLOAD give a HEX dump > that is of no use, and REPORT simply writes 'BYTE > value' into the file, also of no use. Try to use LOCATE statement with named file for you byte variable. It should be something like this: define pic byte define file_name char(256) define cmd char(256) let file_name = "/wwwroot/images/1.gif" locate pic in file file_name initialize pic to NULL select picture into pic from images where image_name = "1.gif" -- ddv > > I know the byte value is O.K., as I am able to use > DELPHI to store and retrieve the value. > > Aside from buying the Universal server options, is > there a way to display a BYTE in a browser? Has > anyone done this? > > ===== > Sky Southwell > Data Management > Maricopa County Attorney's Office > Phoenix, AZ 85003 > southwel@mcao.maricopa.gov > > Sent via Deja.com http://www.deja.com/ > Share what you know. Learn what you don't. > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
In article <7r3ocf$5f$1@nnrp1.deja.com>, southwel@my-deja.com wrote: > I've written a cgi program (INFORMIX-4GL Version > 6.00.UE3) that works very well at querying and > displaying data from an IDS database to an HTML > page. Problem: I now have a need to display a > BYTE value (JPG). I realize the IMG tag needs a > URI, so I am attempting to save the BYTE to a temp > file, then display that. UNLOAD give a HEX dump > that is of no use, and REPORT simply writes 'BYTE > value' into the file, also of no use. Try to use LOCATE statement with named file for you byte variable. It should be something like this: define pic byte define file_name char(256) define cmd char(256) let file_name = "/wwwroot/images/1.gif" locate pic in file file_name initialize pic to NULL select picture into pic from images where image_name = "1.gif" -- ddv > > I know the byte value is O.K., as I am able to use > DELPHI to store and retrieve the value. > > Aside from buying the Universal server options, is > there a way to display a BYTE in a browser? Has > anyone done this? > > ===== > Sky Southwell > Data Management > Maricopa County Attorney's Office > Phoenix, AZ 85003 > southwel@mcao.maricopa.gov > > Sent via Deja.com http://www.deja.com/ > Share what you know. Learn what you don't. > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
In article <7r3ocf$5f$1@nnrp1.deja.com>, southwel@my-deja.com wrote: > I've written a cgi program (INFORMIX-4GL Version > 6.00.UE3) that works very well at querying and > displaying data from an IDS database to an HTML > page. Problem: I now have a need to display a > BYTE value (JPG). I realize the IMG tag needs a > URI, so I am attempting to save the BYTE to a temp > file, then display that. UNLOAD give a HEX dump > that is of no use, and REPORT simply writes 'BYTE > value' into the file, also of no use. Try to use LOCATE statement with named file for you byte variable. It should be something like this: define pic byte define file_name char(256) define cmd char(256) let file_name = "/wwwroot/images/1.gif" locate pic in file file_name initialize pic to NULL select picture into pic from images where image_name = "1.gif" -- ddv > > I know the byte value is O.K., as I am able to use > DELPHI to store and retrieve the value. > > Aside from buying the Universal server options, is > there a way to display a BYTE in a browser? Has > anyone done this? > > ===== > Sky Southwell > Data Management > Maricopa County Attorney's Office > Phoenix, AZ 85003 > southwel@mcao.maricopa.gov > > Sent via Deja.com http://www.deja.com/ > Share what you know. Learn what you don't. > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.