?
Solved

Retrieve dynamic HTML form fields using PL/SQL

Posted on 2007-08-07
10
Medium Priority
?
345 Views
Last Modified: 2013-12-07
I've created an HTML form which will submit to a PL/SQL package, however, I have buttons allowing the user to add an unlimited number of lines to the form. (Using Javascript). So, I'm unable to know the exact number of variables coming into PL/SQL. In ASP, I would do something like:

For each item in Request.Form
  Response.Write item & " = " & Request.Form(item) & "<br>"
Next

Can I do the same thing in PL/SQL? Is there a way to retrieve the entire collection of submitted variables?

TIA!
0
Comment
Question by:L00M
  • 5
  • 3
9 Comments
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 19648936
DHTML and dynamic form fields have always caused me problems.

I'm not sure exactly what you are asking here.  Are you wanting to know how to loop through items passed into PL/SQL or how to pass them into PL/SQL?

Straight ASP or ASP.Net?
0
 
LVL 11

Author Comment

by:L00M
ID: 19649041
The ASP code I provided is Classic ASP, just as an example.

And, yes, if I could loop through the form items submitted to the package, that would get me on the right track. Since it's dynamic, I can't just define the package like:

PROCEDURE p_submit_request(email varchar2 default null,
                          phone varchar2 default null, ...)

I won't know what those values are. I know they will be something like:

email_1, email_2, email_n
And I will be passing in a variable named 'totalcount' which will be equal to the number 'n' above.

Clear enough? If not, I'll try to clarify more.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 19649406
It's been a LONG time since I've messed with classic ASP so I really doubt I'll be much help on that side.

Depending on your Oracle version and the data provider you are using (I hope not ODBC), I'm sure if you can access the form fields, we can get the data into PL/SQL.

Off the top of my head I'd probably go with passing the data in as XML.  A close second is passing them in as an 'Associative Array'.  Again, all this depends on your provider and Oracle version.
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 11

Author Comment

by:L00M
ID: 19649496
My question has nothing to do with ASP, I was providing that as an example of how I would do it in ASP. Clear your head  of that :)

As for the HTML form, as you can see, it's submitting it's data to ekeddpst.p_continue_form:

<FORM ACTION="ekeddpst.p_continue_form" METHOD="POST" onSubmit="return ValidateData()" NAME="valform" >

So, the data isn't being submitted as XML or as an associative array. It's simply a standard HTML form submit.

IE, if my form looked like:

<FORM ACTION="ekeddpst.p_continue_form" METHOD="POST" onSubmit="return ValidateData()" NAME="valform" >
<input name="input_1" value="1"><br>
<input name="input_2" value="2"><br>
...
<input name="input_n" value="n"><br>
<INPUT TYPE="submit" VALUE="Go">

So, not knowing the value of 'n', or how many fields there will be submitted (dynamic), how can I enumerate through every submitted field?

TIA
0
 
LVL 11

Author Comment

by:L00M
ID: 19649520
p_continue_form is a function within the package ekeddpst
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 19653276
>>Clear your head  of that :)

Cleared.  Sorry for the confusion.  I thought you had an ASP form that in turn called procedure from the server side script.

Never called a PL/SQL function straight from a web form.  I'll have to leave this to the other experts.
0
 
LVL 11

Author Comment

by:L00M
ID: 19662555
I ended up forcing the form to use no more than a defined static number of fields, and defaulting all incoming values to NULL.
Not the solution I'd like, but it'll just have to do until I learn more about PL/SQL.
Further comments are welcome.
0
 
LVL 11

Author Comment

by:L00M
ID: 20177651
PAQ with refund will be fine with me unless anyone else has objections.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 20210782
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question