I am trying to execute a stored procedure in asp and display its out parameters. I am using the ADOB.Command Object and setting the in/out parameters using the createparameter property. The procedure works fine from a sql prompt. However, I can not get it to run via ASP.
Note: From the sql prompt, I am declaing the out variables directly before executing the procedure. I am also printing the out variables directly after the procedure call with dbms print statements from the prompt. Could this procedure design/setup be causing my asp not to execute the procedure?
Could someone please help me define what I am doing wrong, so that I may execute a procedure in ASP.
----------------------
PROCEDURE DESCRIPTION:
----------------------
procedure cisx_temp_dashboard_pr
(p_user_id in number,
p_customer_id in number,
p_first_name out varchar2,
p_last_name out varchar2,
p_account_name out varchar2,
p_login_wtd out number,
p_open_po_count out number,
p_open_schedule_count out number,
p_error_message out varchar2
)
-------------------------------------
EXECUTE PROCEDURE FROM ORACLE PROMPT:
-------------------------------------
set serveroutput on
execute dbms_output.enable(1000000);
declare
p_first_name varchar2(100);
p_last_name varchar2(100);
p_account_name varchar2(100);
p_login_wtd number;
p_open_po_count number;
p_open_schedule_count number;
p_error_message varchar2(300);
Begin
CISX_DASHBOARD_PR(1071,
3602,
p_first_name,
p_last_name,
p_account_name,
p_login_wtd,
p_open_po_count,
p_open_schedule_count,
p_error_message);
dbms_output.put_line('p_first_name: '|| p_first_name);
dbms_output.put_line('p_last_name: '|| p_last_name);
dbms_output.put_line('p_account_name: '|| p_account_name);
dbms_output.put_line('p_login_wtd: '|| p_login_wtd);
dbms_output.put_line('p_open_po_count: '|| p_open_po_count);
dbms_output.put_line('p_open_schedule_count: '|| p_open_schedule_count);
dbms_output.put_line(substr(p_error_message,1,300));
End;
/
---------------------------------
RESULTS FROM PROCEDURE AT PROMPT:
---------------------------------
p_first_name: test
p_last_name: test
p_account_name: Test Account
p_login_wtd: 0
p_open_po_count: 37
p_open_schedule_count: 59
---------------------------------
ASP CODE
---------------------------------
Dim comm
set comm = Server.CreateObject("ADOB.Command"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
'conn refers to a Connection object
'that has out database connection
object set comm.ActiveConnection = conn
comm.commandtype = 4
comm.commandtext = "cisx_dashboard_pr"
'build parammeter list for stored procedure
set param = comm.createparameter("P_USER_ID", adInteger,adParamInput)
.....
...I am build all of my parmaters in/out as above
...no need to mention them all
...
'set parameters of stored procedure
comm.parameters.append param
'pass the input values to the procedure
comm("P_USER_ID"
= 1071
comm("P_CUSTOMER_ID"
= 3602
'EXECUTE
datacomm.Execute
response.WriteLine "start"
response.WriteLine "first_name: " & comm("P_FIRST_NAME"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
response.WriteLine "end"
------------
ASP OUTPUT:
------------
start
end
----------
QUESTIONS:
----------
1) How can I make the above code work? My asp page is not erroring out, and yet it does not display any results. However, there clearly are results from the db command prompt test?
PLEASE HELP
THANK YOU, THANK YOU, THANK YOU, THANK YOU!!!!!
Note: From the sql prompt, I am declaing the out variables directly before executing the procedure. I am also printing the out variables directly after the procedure call with dbms print statements from the prompt. Could this procedure design/setup be causing my asp not to execute the procedure?
Could someone please help me define what I am doing wrong, so that I may execute a procedure in ASP.
----------------------
PROCEDURE DESCRIPTION:
----------------------
procedure cisx_temp_dashboard_pr
(p_user_id in number,
p_customer_id in number,
p_first_name out varchar2,
p_last_name out varchar2,
p_account_name out varchar2,
p_login_wtd out number,
p_open_po_count out number,
p_open_schedule_count out number,
p_error_message out varchar2
)
-------------------------------------
EXECUTE PROCEDURE FROM ORACLE PROMPT:
-------------------------------------
set serveroutput on
execute dbms_output.enable(1000000);
declare
p_first_name varchar2(100);
p_last_name varchar2(100);
p_account_name varchar2(100);
p_login_wtd number;
p_open_po_count number;
p_open_schedule_count number;
p_error_message varchar2(300);
Begin
CISX_DASHBOARD_PR(1071,
3602,
p_first_name,
p_last_name,
p_account_name,
p_login_wtd,
p_open_po_count,
p_open_schedule_count,
p_error_message);
dbms_output.put_line('p_first_name: '|| p_first_name);
dbms_output.put_line('p_last_name: '|| p_last_name);
dbms_output.put_line('p_account_name: '|| p_account_name);
dbms_output.put_line('p_login_wtd: '|| p_login_wtd);
dbms_output.put_line('p_open_po_count: '|| p_open_po_count);
dbms_output.put_line('p_open_schedule_count: '|| p_open_schedule_count);
dbms_output.put_line(substr(p_error_message,1,300));
End;
/
---------------------------------
RESULTS FROM PROCEDURE AT PROMPT:
---------------------------------
p_first_name: test
p_last_name: test
p_account_name: Test Account
p_login_wtd: 0
p_open_po_count: 37
p_open_schedule_count: 59
---------------------------------
ASP CODE
---------------------------------
Dim comm
set comm = Server.CreateObject("ADOB.Command"
'conn refers to a Connection object
'that has out database connection
object set comm.ActiveConnection = conn
comm.commandtype = 4
comm.commandtext = "cisx_dashboard_pr"
'build parammeter list for stored procedure
set param = comm.createparameter("P_USER_ID", adInteger,adParamInput)
.....
...I am build all of my parmaters in/out as above
...no need to mention them all
...
'set parameters of stored procedure
comm.parameters.append param
'pass the input values to the procedure
comm("P_USER_ID"
comm("P_CUSTOMER_ID"
'EXECUTE
datacomm.Execute
response.WriteLine "start"
response.WriteLine "first_name: " & comm("P_FIRST_NAME"
response.WriteLine "end"
------------
ASP OUTPUT:
------------
start
end
----------
QUESTIONS:
----------
1) How can I make the above code work? My asp page is not erroring out, and yet it does not display any results. However, there clearly are results from the db command prompt test?
PLEASE HELP
THANK YOU, THANK YOU, THANK YOU, THANK YOU!!!!!