Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie Quest - passing selected form values to another procedure
A copy of this was sent to Brian Richardson <RichaBK_at_kscgws00.ksc.nasa.gov>
(if that email address didn't require changing)
On Thu, 03 Sep 1998 13:24:46 -0400, you wrote:
>Hi all,
>
>I am using Sun hardware with Oracle v7.3.x, Oracle Web Server v3,
>Netscape browser
>(pc client), PL/SQL packages, and I am trying to do the following:
>
>I've created an html page allowing the user to select items from 2
>different pull-down select lists;
>User selections are to be sent to another procedure upon submission (via
>POST method)
>
>I am having trouble getting the references set up correctly, and am
>getting the error message
>Invalid reference to variable 'variable1' in Procedure A when compiling
>
>the following snippet illustrates how I'm proceeding:
>
>in Procedure A, the HTML page building for user selection from 2 lists
>includes the following....
>
> htp.formOpen('url of procedure to invoke upon submission','POST');
> htp.formHidden('variable1',variable1,NULL);
> htp.formHidden('variable2',variable2,NULL):
>
Q) did you declare variable1 and variable2 as PL/SQL local variables in procedure A? You have to if you are going to reference them as you have above.
Q) why are you 'hiding' variable1 and variable2 in procedure A? I thought you wanted to let the user pick them from a list.
Here is an example of proca and procb where
create or replace procedure procA
as
begin
htp.formOpen( 'procB', 'POST' );
htp.formSelectOpen( 'variable1', 'V1:', 1 ); htp.formSelectOption( '1', 'SELECTED' ); htp.formSelectOption( '2' ); htp.formSelectOption( '3' ); htp.formSelectClose;
htp.br;
htp.formSelectOpen( 'variable2', 'V2:', 1 ); htp.formSelectOption( '1', 'SELECTED' ); htp.formSelectOption( '2' ); htp.formSelectOption( '3' ); htp.formSelectClose;
htp.br;
htp.formSubmit;
htp.formClose;
end;
/
create or replace procedure procB( variable1 in varchar2, variable2 in varchar2
)
is
begin
htp.p( 'V1 = ' || variable1 ); htp.br; htp.p( 'V2 = ' || variable2 );
See, in PROCA the PL/SQL variables variable1 and variable2 *do not exist*. We never reference them. In procB they exist and we can use them.
hope this helps...
> === further form population code snipped ====
>
>in Procedure B, the entry point line is as follows:
>
>PROCEDURE B
> (variable1 IN varchar2,
> variable2 IN varchar2) IS
>
>I am assuming that, upon submission, variable1 and variable2 will be
>passed to Procedure B; where they will be used to access relevant
>info. from the database (variable1 is a table name, variable2 is an
>operation to be performed).
>
>I hope I have provided enough information for someone to respond;
>if not, please let me know and I will post additional info.
>
>Also, if anyone can point me to an example of this type of application,
>I would be most appreciative.
>
>Thanks in advance for any responses.
>
>Brian Richardson
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Sep 03 1998 - 13:23:45 CDT
![]() |
![]() |