PDA

View Full Version : Sample code for PLSQL Web


Scott Johnson
09-14-2004, 05:41 PM
I'm having a difficult time tryng to get some web code working for pl/sql.
I have a html procedure that accepts a parameter and looks up data based on
that parameter. If the parameter doesn't exist, then display text entry
field and recall the procedure with the value entered.

It looks like htp.isindex might work but I'm not sure how to implement.

Does anyone have or know of some example code to help me out.

Thanks,
Scott

Pete Finnigan
09-15-2004, 01:04 AM
Hi Scott,

Not a direct answer to your question, but I have always found a post
made by Norman probably a couple of years ago very useful in getting up
and running with PL/SQL and websites and Oracle. You can read his post
here:

http://www.orafaq.net/archive/comp.databases.oracle.server/2003/01/29/17
3913.raw

hth

kind regards

Pete
--
Pete Finnigan
email:pete@petefinnigan.com
Web site: http://www.petefinnigan.com - Oracle security audit specialists
Book:Oracle security step-by-step Guide - see http://store.sans.org for details.

Mark C. Stock
09-15-2004, 01:56 AM
"Pete Finnigan" <plsql@petefinnigan.com> wrote in message
news:VnrZDKBzWASBRxG4@peterfinnigan.demon.co.uk...
| Hi Scott,
|
| Not a direct answer to your question, but I have always found a post
| made by Norman probably a couple of years ago very useful in getting up
| and running with PL/SQL and websites and Oracle. You can read his post
| here:
|
| http://www.orafaq.net/archive/comp.databases.oracle.server/2003/01/29/17
| 3913.raw
|

that's a 404, pete

Mark C. Stock
09-15-2004, 02:42 AM
"Scott Johnson" <stj_spam@yahoo.com> wrote in message
news:41479b73$0$26108$bb8e7a08@news.usenetcompany.com...
| I'm having a difficult time tryng to get some web code working for pl/sql.
| I have a html procedure that accepts a parameter and looks up data based
on
| that parameter. If the parameter doesn't exist, then display text entry
| field and recall the procedure with the value entered.
|
| It looks like htp.isindex might work but I'm not sure how to implement.
|
| Does anyone have or know of some example code to help me out.
|
| Thanks,
| Scott
|
|

here's the issues you have to deal with, some standard pl/sql, and some
toolkit-specific, some HTML-specific


htp.isindex generates, not surprisingly, an HTML <isindex> tag, which has
been deprecated as of HTML 4.0. this points out one of the problems of
relying on the htp calls -- better to get a good HTML reference (like Danny
Goodman's O'Reilly Book 'Dynamic HTML - The Complete Reference) and write
code to generate your own DHTML than rely on htp's half-baked and often
obsolete wrappers for HTML

<ISINDEX> belongs in the <HEAD> element -- you won't learn that from the
toolkit documentation, hence the need to dig into DHTML directly

better to design a page that uses <FORM> and <INPUT> elements


it sounds like you simply want the procedure to call itself again if the
database lookup fails, perhaps with an error message, but you don't specify
what should happen if it succeeds -- should it allow the user to execute
another search? i'll assume yes


so, first thing you need to do, is map out the logic and structure of your
procedure(s), as you would with any programming language. to handle it all
in one procedure, you need something like this:

[_] generate HTML page and body header tags
[_] if a parameter is passed (ie, first call would be with a null parameter)
attempt database lookup
if database lookup succeeds, display results (generate HTML to display
results)
if database lookup fails, display error message
[_] always generate HTML <FORM> and <INPUT> elements to prompt for another
search
the action of the <FORM> element is the name of this procedure
the name of the <INPUT> text element is the name of the procedure's
parameter
[_] generate HTML body and page end tags

refer to the sample code zipped with my paper (I think you already
downloaded it from (www.enquery.com/presentations), specifically the
packages EMPS_PKG, EMPS_PKG02 and EMPS_PKG03 for examples on performing
queries based on a parameter.


later on today i'll post another set of sample procedures that illustrates
using an HTML form as i've described above

++ mcs

Pete Finnigan
09-15-2004, 03:02 AM
In article <CumdnV4LIKRfjNXcRVn-uA@comcast.com>, Mark C. Stock
<mcstockX@Xenquery.com> writes"Pete Finnigan" <plsql@petefinnigan.com> wrote in messagenews:VnrZDKBzWASBRxG4@peterfinnigan.demon.co.uk...| Hi Scott,|| Not a direct answer to your question, but I have always found a post| made by Norman probably a couple of years ago very useful in getting up| and running with PL/SQL and websites and Oracle. You can read his post| here:|| http://www.orafaq.net/archive/comp.databases.oracle.server/2003/01/29/17| 3913.raw|that's a 404, pete
Hi Mark,

I visited it this morning just before I posted this, i even cut and
pasted the link from IE.

Just did visited it again now and its OK.

Looks like the issue might be your end?

Kind regards

Pete

BTW: did you get my second email?, you said you didn't get the first, i
replied again but didn't hear back from you.
--
Pete Finnigan
email:pete@petefinnigan.com
Web site: http://www.petefinnigan.com - Oracle security audit specialists
Book:Oracle security step-by-step Guide - see http://store.sans.org for details.

Mark C. Stock
09-15-2004, 03:15 AM
"Pete Finnigan" <plsql@petefinnigan.com> wrote in message
news:HFN9rLBpECSBRxnv@peterfinnigan.demon.co.uk...
| In article <CumdnV4LIKRfjNXcRVn-uA@comcast.com>, Mark C. Stock
| <mcstockX@Xenquery.com> writes
| >
| >"Pete Finnigan" <plsql@petefinnigan.com> wrote in message
| >news:VnrZDKBzWASBRxG4@peterfinnigan.demon.co.uk...
| >| Hi Scott,
| >|
| >| Not a direct answer to your question, but I have always found a post
| >| made by Norman probably a couple of years ago very useful in getting up
| >| and running with PL/SQL and websites and Oracle. You can read his post
| >| here:
| >|
| >|
http://www.orafaq.net/archive/comp.databases.oracle.server/2003/01/29/17
| >| 3913.raw
| >|
| >
| >that's a 404, pete
| >
| >
| Hi Mark,
|
| I visited it this morning just before I posted this, i even cut and
| pasted the link from IE.
|
| Just did visited it again now and its OK.
|
| Looks like the issue might be your end?
|
| Kind regards
|
| Pete
|

heading out now... i'll check it later

OT: did you get my email about oracle hardening on the east coast?

++ mcs

Pete Finnigan
09-15-2004, 04:02 AM
In article <mpSdnZqfdKXludXcRVn-ow@comcast.com>, Mark C. Stock
<mcstockX@Xenquery.com> writes"Pete Finnigan" <plsql@petefinnigan.com> wrote in messagenews:HFN9rLBpECSBRxnv@peterfinnigan.demon.co.uk...| In article <CumdnV4LIKRfjNXcRVn-uA@comcast.com>, Mark C. Stock| <mcstockX@Xenquery.com> writes| >| >"Pete Finnigan" <plsql@petefinnigan.com> wrote in message| >news:VnrZDKBzWASBRxG4@peterfinnigan.demon.co.uk...| >| Hi Scott,| >|| >| Not a direct answer to your question, but I have always found a post| >| made by Norman probably a couple of years ago very useful in getting up| >| and running with PL/SQL and websites and Oracle. You can read his post| >| here:| >|| >|http://www.orafaq.net/archive/comp.databases.oracle.server/2003/01/29/17| >| 3913.raw| >|| >| >that's a 404, pete| >| >| Hi Mark,|| I visited it this morning just before I posted this, i even cut and| pasted the link from IE.|| Just did visited it again now and its OK.|| Looks like the issue might be your end?|| Kind regards|| Pete|heading out now... i'll check it laterOT: did you get my email about oracle hardening on the east coast?++ mcs
OT: yes i did get your emails and replied twice, i think for some reason
you are not receiving my mails? - I will try again from another account.

cheers

pete
--
Pete Finnigan
email:pete@petefinnigan.com
Web site: http://www.petefinnigan.com - Oracle security audit specialists
Book:Oracle security step-by-step Guide - see http://store.sans.org for details.


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service