SQL to HTML
Posted in 2000
Topics: General Discussion
I've called Informix Sales several times trying to get an answer to this - to no avail.... Does anyone know what product I would need to convert my SQL forms to HTML? I am using 7.31 UC5 on a Sun E10K. If Informix does not have anything, do you know of any other? Thanks Robin
How are you with parsing languages - awk, perl, etc ? It's a long time since I looked at HTML, but something like this (psedo-awk) could work ... # set up header info BEGIN { print "<HTML>" print "<HEAD>" print "<TITLE>" FILENAME "<\\TITLE>" print "</HEAD>" print "<BODY>" print "<FORM>" # HTML? print "<TABLE> started = 0 } $1 ~ /{/ { # start of screen section, first field matches brace started = 1 next # dont actually want that brace } $1 ~ /}/ { # end of screen section, first field matches closing # brace started = 0 } started == 0 { next } { # on every line that gets here # this bit changes field start and end gsub(/\\[/, "</TD><field tag=" ) # You need to change this bit to # match HTML field syntax gsub(/\\]/, "></field></TD><TD>" ) # And this bit print "<TR><TD>" $0 "</TD></TR>" # print a row, containing all text } # tidy up the footer END { print "</FORM>" # HTML? print "</TABLE> print "</BODY>" print "</HTML>" } Save the above as an awk file, run this awk -f awk.file form.per > form.html A better solution would read the database schema into memory, read your .per file, analysing the field definitions, and put data type validation into the form, then print the html file. If you redirect the the output, you could do all your forms in one hit Robert Stuart Boscia wrote: > I've called Informix Sales several times trying to get an answer to this - > to no avail.... > > Does anyone know what product I would need to convert my SQL forms to HTML? > I am using 7.31 UC5 on a Sun E10K. > > If Informix does not have anything, do you know of any other? > > Thanks > Robin