WWW and Informix (WAS Re: WWW-friendly SQL databases?)
Posted in 1994
Topics: Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
In article <jcloete.145.0009178F@mikomtek.csir.co.za> jcloete@mikomtek.csir.co.za (Laurens Cloete) writes: [comments deleted] >Presently gsql backends exist for Sybase and Oracle. I would be interested in Informix tells me they have someone working on a gsql backend >Informix and/or ODBC backends. I am using pure Informix 4GL. I capture the forms data from Mosaic or Netscape with the following poorly written c routine called from Informix. (Yes I know what malloc is). www_init(){ register int x; int cl; char buf[200]; printf("Content-type: text/html%c%c",10,10); cl = atoi(getenv("CONTENT_LENGTH")); for(x=0;x<cl;x++) { buf[x] = fgetc(stdin); } retquote(buf,cl); return(1); } I then do all my SQL stuff in pure INFORMIX 4GL. MAIN DEFINE buf CHAR(1000) ..... CALL www_init() RETURNING buf CALL StartDocument() ..... END MAIN The 4GL "DISPLAY" command works just fine for constructing my dynamic html, e.g.: FUNCTION StartDocument () DISPLAY "" DISPLAY "<HTML><HEAD><TITLE>National Park Service DSC Document Query</TITLE></ HEAD>" DISPLAY "<CENTER>" DISPLAY "<BODY><H1>National Park Service</H1>" DISPLAY "<H2>Denver Service Center</H2>" DISPLAY "<H2><IMG ALIGN=middle SRC=""/icons/npssym.gif""> Technical Informatio n Center Data Retrieval</H2>" DISPLAY "</CENTER>" END FUNCTION I then compile the program, stick it in /usr/local/etc/httpd/cgi-bin in a poorly written shell script #!/bin/csh source ~hal/.cshrc ./www.4ge and it all works. I am doing this all using NCSA httpd on a SUN Sparc 20 Model 61 under Solaris 2.3 using Informix On-Line 5.02. Informix 4GL is converted to c code by the Informix c4gl utility so it is about as fast as anything written in c. It links in a couple of hundred K of libraries - whether you need them or not, however, so you executable can easily be 400K or more. 4GL is very good at handling strings and SQL - you can actually read and understand the code. For more detail, please email and I will post comments here. Hal