Home » SQL & PL/SQL » SQL & PL/SQL » error while executing the procedure
error while executing the procedure [message #188286] Thu, 17 August 2006 16:47 Go to next message
miracle_with_oracle
Messages: 13
Registered: June 2006
Junior Member
hi masters,

I created the following code and tried to execute it . But it showing error.Then i tried to execute by giving
http://hostname:portnumber/plsql?procedure_name

But it is showing error.

Can anybody tell me the procedure to execute this?
I have oracle database 10g (10.2) and oracle developer suite 10g loaded on my system. I tried to search for mod_plsql in the Apache directory but couldn't find it.

Please help me.

********************************************************
SQL> CREATE OR REPLACE PROCEDURE html_page
2 IS
3 BEGIN
4 HTP.HTMLOPEN; -- generates <HTML>
5 HTP.HEADOPEN; -- generates <HEAD>
6 HTP.TITLE('Title'); -- generates <TITLE>Hello</TITLE>
7 HTP.HEADCLOSE; -- generates </HTML>
8
9 -- generates <BODY TEXT="#000000" BGCOLOR="#FFFFFF">
10 HTP.BODYOPEN( cattributes => 'TEXT="#000000" BGCOLOR="#FFFFFF"');
11
12 -- generates <H1>Heading in the HTML File</H1>
13 HTP.HEADER(1, 'Heading in the HTML File');
14
15 HTP.PARA; -- generates <P>
16 HTP.PRINT('Some text in the HTML file.');
17 HTP.BODYCLOSE; -- generates </BODY>
18 HTP.HTMLCLOSE; -- generates </HTML>
19 END;
20 /

Procedure created.

SQL> begin
2 html_page;
3 end;
4 /
begin
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 325
ORA-06512: at "SYS.HTP", line 1322
ORA-06512: at "SYS.HTP", line 1397
ORA-06512: at "SYS.HTP", line 1689
ORA-06512: at "SYS.HTP", line 71
ORA-06512: at "SCOTT.HTML_PAGE", line 4
ORA-06512: at line 2

******************************************************
Re: error while executing the procedure [message #188290 is a reply to message #188286] Thu, 17 August 2006 17:45 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You need to modify line 10 of your procedure to the following:

HTP.BODYOPEN( cattributes => 'TEXT="#000000" cbackground => BGCOLOR="#FFFFFF"');
Re: error while executing the procedure [message #188299 is a reply to message #188290] Thu, 17 August 2006 19:08 Go to previous messageGo to next message
miracle_with_oracle
Messages: 13
Registered: June 2006
Junior Member
hello ebrain,

Thanks for the reply. The problem is not with the procedure.
I have successuflly executed this procedure in the sql*plus. But my problem is how to run this procedure as a url in the browser.

I tried to give the following url , it showed me "no page found".

http://hostname:portname/mod_dms/procedure_name


Please tell me how to execute this procedure using a url.

Thanks
Re: error while executing the procedure [message #188303 is a reply to message #188286] Thu, 17 August 2006 19:47 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>I have successuflly executed this procedure in the sql*plus.
>I tried to give the following url , it showed me "no page found".
Between the two line above EXACTLY what did you do so that Apache had a fighting chance to actually find said procedure?
Simply testing the procedure in SQL*Plus & placing a URL in a browser is not sufficient to get the procedure served to the browser.

Rhetorical questions -
Which Oracle user/schema has rights to execute said procedure?
How does Apache "know" with which username/password to access said procedure?
Which manual have you read & followed in setting up your environment; Oracle DB, Apache, etc?

Re: error while executing the procedure [message #188315 is a reply to message #188286] Thu, 17 August 2006 22:17 Go to previous message
miracle_with_oracle
Messages: 13
Registered: June 2006
Junior Member
hi anecedent,

Actually i have created the "hello" procedure in scott/tiger@instance. So when i executed in sqlplus , it was successfully done as shown below:

****************************************************

SQL> begin
2 sys.owa_util.showpage;
3 end;
4 /
<HTML>
<HEAD>
<TITLE>Hello World Program</TITLE>
</HEAD>
<BODY text="#000000" bgcolor="#ffffff">
<B>Hello World</B>
<BR>
<BR>
System date and time is : 08/17/2006 17:37:01
<BR>
helloworld
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Hello World Program</TITLE>
</HEAD>
<BODY text="#000000" bgcolor="#ffffff">
<B>Hello World</B>
<BR>
<BR>
System date and time is : 08/17/2006 17:37:40
<BR>
helloworld
</BODY>
</HTML>

PL/SQL procedure successfully completed.

*********************************************

In 10g , i searched for mod_sql in apache directory but could only find dms conf file. So i searched in OracleŽ Database Application Developer's Guide - Fundamentals
10g Release 2 (10.2)
but i didn't get configuration information. So didn't really understand how to configure .

Do i need to install oracle application server 10g or mod_sql to run this procedure in the url. Please guide me.
Previous Topic: How to select Default value from column ?
Next Topic: DBMS_OUTPUT.ENABLE (500000);
Goto Forum:
  


Current Time: Thu Dec 08 14:22:48 CST 2016

Total time taken to generate the page: 0.11916 seconds