Home » SQL & PL/SQL » SQL & PL/SQL » ORA-24338: statement handle not executed
ORA-24338: statement handle not executed [message #12585] Wed, 26 May 2004 09:07 Go to next message
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 #13732 is a reply to message #12585] Mon, 26 July 2004 00:17 Go to previous messageGo to next message
rajesh
Messages: 173
Registered: November 1998
Senior Member
Hi,
If you already have found the solution for this then please tell me what is the fix, as I am also getting the same problem.

Thanks
Rajesh
Re: ORA-24338: statement handle not executed [message #14373 is a reply to message #12585] Tue, 24 August 2004 01:21 Go to previous messageGo to next message
Hari Prasad Kalakada
Messages: 1
Registered: August 2004
Junior Member
The reason for that is,
you might be opening a cursor (for select stmt) with in if condition which is failing.
Re: ORA-24338: statement handle not executed [message #15035 is a reply to message #14373] Mon, 20 September 2004 04:41 Go to previous message
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.
Previous Topic: Move a standalone function into a Package
Next Topic: sql query
Goto Forum:
  


Current Time: Wed May 01 10:17:29 CDT 2024