Re: Q: newbie Oracle/Web question

From: James P. Cooper <pixel_at_yoda.coe.missouri.edu>
Date: 1996/09/13
Message-ID: <51cj92$1buc_at_news.missouri.edu>#1/1


In article <5174ls$7lv_at_linet01.li.net>,

        gsa_at_li.net (Gary Assa) writes:
>I want to run a SQL script with user-inputted values from a web page.
 

>Can I do this?
>If I use <FORM> how do I get the variables sent to sqlplus?
>Do I have to call another script?

Well, you'll need to parse the CGI input. I would really recommend using something like perl to do that since there are a variety of CGI libraries that you can use to parse the input for you.

If you don't use perl, and your <FORM> uses METHOD="GET", then the data will be in an environment variable called QUERY_STRING. The format of the string will be:

variable1name=variable1data&variable2name=variable2data

non alphanumeric characters will be encoded in "URL style" with a % followed by the hex value for the character.

Bottom line: use something besides shell to parse it...it can get ugly.

Out of curiosity, was SQL*Plus formatting the HTML for you (I assume not), or was it returning data to the shell script?

If you know perl (or wouldn't mind learning it) then I would definately recommend DBI.pm available from:
http://www.hermetica.com/technologia/DBI/

That will let you connect Oracle from perl. DBI combined with CGI.pm equals a fast and easy way to write CGI scripts that talk to Oracle.

Good luck

  • James
.........................................................................
                        James Paul Cooper * Pixel
                         MU College of Education
       pixel_at_coe.missouri.edu - http://www.coe.missouri.edu/~pixel/
.........................................................................
Received on Fri Sep 13 1996 - 00:00:00 CEST

Original text of this message