ORA-24338: statement handle not executed [message #12585] |
Wed, 26 May 2004 09:07 |
janeen holland
Messages: 1 Registered: May 2004
|
Junior Member |
|
|
this is the error i get when i try to run my asp page.
ORA-24338: statement handle not executed
/aces/data/data_entry.asp, line 359
here is the code on my page -
Set Comm = Server.CreateObject("ADODB.Command")
Set comm.ActiveConnection = DataConn comm.commandtype=adCmdStoredProc
comm.commandtext = "AWARS.ACES_SELECT.SELECT_MISSILES" lParamSize = len(sMsltype)
if lParamSize = 0 then
lParamSize = cint(1)
end if
set param = comm.createparameter("Missiletype",adVarChar,adParaminput,lParamSize,cstr(sMsltype)) comm.parameters.append param
set rsPn = Comm.Execute() - line 359
here is my procedure
procedure select_missiles (
sMslType in VARCHAR2,
r_cursor out rcursor)
is
iPrgmId integer;
stmt varchar2(2000);
sCount varchar2(100);
sFields varchar2(1000);
sWhere varchar2(1000);
sPrefix varchar2(1000);
sRowCount varchar2(1000);
sSuccess varchar2(250);
c_cursor rcursor;
begin
-- need to get the program id from program table and place in iPrgmId --
sFields := ' select r.program_id';
sWhere := ' from core.program r';
sWhere := sWhere || ' where upper(r.program) = ''' || sMslType || '''';
stmt := sFields || sWhere;
OPEN c_cursor FOR stmt;
fetch c_cursor into iPrgmId;
close c_cursor;
-- get the prefix for the missile from the msl_prefix table in awars --
sFields := 'select m.prefix';
sWhere := ' from awars.msl_prefix m';
sWhere := sWhere || ' where m.program_id = ' || iPrgmId || '';
stmt := sFields || sWhere;
OPEN c_cursor FOR stmt;
fetch c_cursor into sPrefix;
close c_cursor;
-- get list of missiles using iPrgmId --
sWhere := 'from core.item i, core.nsnpartnr n';
sWhere := sWhere || ' where i.item_id = n.item_id';
sWhere := sWhere || ' and i.program_id = ' || iPrgmId || '';
-- add prefix and condense the basemodel and version together --
--sFields := 'select n.partnr, i.nalc, '''||sPrefix||'''||i.basemodel||i.version ';--
sFields := 'select '''||sPrefix||'''||i.basemodel||i.version||'' / ''||i.nalc||'' / ''||n.partnr ';
stmt := sFields || sWhere;
dbms_output.put_line('program id = ' || iPrgmId);
dbms_output.put_line('sWhere = ' || sWhere);
dbms_output.put_line('stmt = ' || stmt);
dbms_output.put_line(length(stmt));
dbms_output.put_line(substr(stmt,1,255));
dbms_output.put_line(substr(stmt,256,255));
dbms_output.put_line(substr(stmt,256,255));
OPEN r_cursor FOR stmt;
exception
when others then
--if SQLCODE = -942 then
sSuccess := 'Error - Table or View does not exist';
stmt := 'select ''' || sSuccess ||''' from dual;';
dbms_output.put_line(stmt);
--end if;
--OPEN r_cursor for stmt;
end select_missiles;
i am new to this so i am not sure what to do and no one else here has seen this error. i know it has something to do with fetch but again not sure. i am using oracle 9i
thanks for your help
|
|
|
|
|
Re: ORA-24338: statement handle not executed [message #15035 is a reply to message #14373] |
Mon, 20 September 2004 04:41 |
Jorge
Messages: 10 Registered: January 2002
|
Junior Member |
|
|
This error also occurs when a Powerbuilder datawindow's datasource is a stored procedure that opens a cursor with the OPEN FOR statement and within the stored procedure an attempt is made to close the cursor.
Do not close the cursor. That fixed the problem for me.
|
|
|