PDA

View Full Version : Problems with PL/SQL Web Toolkit


Alex
11-03-2003, 02:37 AM
Hi,
I'm working with the PL/SQL Web Toolkit. I made some procedures (inside or
outside) package and everything works well.
Now, I would like to call a procedure from an HTML form created by another
procedure.
So, I created one procedure where I use "htp.formopen" to create the form
and some "htp.formtext" for the fields. Then, I created the second procedure
with some parametes in input (one for every field in the form).
When I execute the first procedure I see the right web page, but when I call
the second procedure with the "submit" buttone, I receive the "Not found"
error.
If I try to execute the same procedure without the parametes, everything
woks well.

Have I to change something in the configuration of the PL/SQL Web Toolkit?
Someone knows what is the problem?

Thanks
Alex

Chris
11-03-2003, 03:24 AM
"Alex" <alex.iava__NOSPAM__@tiscali.it> wrote in message
news:bo5b63$8va$1@newsread.albacom.net... Hi, I'm working with the PL/SQL Web Toolkit. I made some procedures (inside or outside) package and everything works well. Now, I would like to call a procedure from an HTML form created by another procedure. So, I created one procedure where I use "htp.formopen" to create the form and some "htp.formtext" for the fields. Then, I created the second
procedure with some parametes in input (one for every field in the form). When I execute the first procedure I see the right web page, but when I
call the second procedure with the "submit" buttone, I receive the "Not found" error. If I try to execute the same procedure without the parametes, everything woks well. Have I to change something in the configuration of the PL/SQL Web Toolkit? Someone knows what is the problem? Thanks Alex

Can you supply the code for the form and the procedure

Alex
11-03-2003, 03:38 AM
"Chris" <cs123._no_spam_@telstra.com> wrote in message news:%Vqpb.176918$bo1.90225@news-server.bigpond.net.au...
[cut] Can you supply the code for the form and the procedure
The code of the first procedure ("Prova_form") is:

procedure PROVA_FORM as
begin
htp.htmlopen;
htp.headopen;
htp.print('<script language="JavaScript">');
htp.print('function checkForm(f)');
htp.print(' {');
htp.print(' if ((f.nome.value == "") || (f.cognome.value == ""))');
htp.print(' {');
htp.print(' alert("Inserire il nome e il cognome")');
htp.print(' return false');
htp.print(' }');
htp.print(' else');
htp.print(' {');
htp.print(' return true');
htp.print(' }');
htp.print(' }');
htp.print('</script>');
htp.headclose;
htp.bodyopen(cattributes => 'bgcolor="#800000"');
htp.fontopen('#c0c0c0', cface => 'Verdana', csize => '4');
htp.formopen('web_pack.risultato', 'GET', cattributes => 'name="miaForm" onsubmit="return checkForm(this)"');
htp.bold('Indicare il nome: ');
htp.formtext('nome', '25', '20', null, 'style="color: #0000ff;"');
htp.br;
htp.bold('Indicare il cognome: ');
htp.formtext('cognome', '25', '20', null, 'style="color: #0000ff;"');
htp.br;
htp.formsubmit('btnSubmit', 'INVIA');
htp.formclose();
htp.fontclose;
htp.br;
st_tabella2;
htp.bodyclose;
htp.htmlclose;
end PROVA_FORM;

The code of the second proc ("risultato") is:

procedure RISULTATO(nome in varchar2 default null,
cognome in varchar2 default null) as
begin
htp.print(nome);
htp.print(cognome);
exception
when others then
htp.print('Errore');
end RISULTATO;

I modified the settings for the "Package/Session State" in the DAD configuration and I selected "Stateless (Perserve Package State)". With this last update, I have no errors if I call the second procedure ("risultato") with parameters in the URL (i.e. web_pack.risultato?nome=aaaa&cognome=bbbb). But If I try to execute it as result of the form I get the errors...
Could you please help me?
Thanks
Alex

Chris
11-03-2003, 11:17 PM
"Alex" <alex.iava__NOSPAM__@tiscali.it> wrote in message news:bo5emu$c3q$1@newsread.albacom.net...

"Chris" <cs123._no_spam_@telstra.com> wrote in message news:%Vqpb.176918$bo1.90225@news-server.bigpond.net.au...
[cut] Can you supply the code for the form and the procedure
The code of the first procedure ("Prova_form") is:

procedure PROVA_FORM as
begin
htp.htmlopen;
htp.headopen;
htp.print('<script language="JavaScript">');
htp.print('function checkForm(f)');
htp.print(' {');
htp.print(' if ((f.nome.value == "") || (f.cognome.value == ""))');
htp.print(' {');
htp.print(' alert("Inserire il nome e il cognome")');
htp.print(' return false');
htp.print(' }');
htp.print(' else');
htp.print(' {');
htp.print(' return true');
htp.print(' }');
htp.print(' }');
htp.print('</script>');
htp.headclose;
htp.bodyopen(cattributes => 'bgcolor="#800000"');
htp.fontopen('#c0c0c0', cface => 'Verdana', csize => '4');
htp.formopen('web_pack.risultato', 'GET', cattributes => 'name="miaForm" onsubmit="return checkForm(this)"');
htp.bold('Indicare il nome: ');
htp.formtext('nome', '25', '20', null, 'style="color: #0000ff;"');
htp.br;
htp.bold('Indicare il cognome: ');
htp.formtext('cognome', '25', '20', null, 'style="color: #0000ff;"');
htp.br;
htp.formsubmit('btnSubmit', 'INVIA');
htp.formclose();
htp.fontclose;
htp.br;
st_tabella2;
htp.bodyclose;
htp.htmlclose;
end PROVA_FORM;

The code of the second proc ("risultato") is:

procedure RISULTATO(nome in varchar2 default null,
cognome in varchar2 default null) as
begin
htp.print(nome);
htp.print(cognome);
exception
when others then
htp.print('Errore');
end RISULTATO;

I modified the settings for the "Package/Session State" in the DAD configuration and I selected "Stateless (Perserve Package State)". With this last update, I have no errors if I call the second procedure ("risultato") with parameters in the URL (i.e. web_pack.risultato?nome=aaaa&cognome=bbbb). But If I try to execute it as result of the form I get the errors...
Could you please help me?
Thanks

Alex

I a bit scratchy with my Web PLSQL but you need an parameter in the second procedure to handle the submit item in the form.

Try adding RISULTATO(nome in varchar2 default null, cognome in varchar2 default null, INVIA in varchar2 default null)

That should work OK. Any reason why your using a get method instead of post.


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