Home » Developer & Programmer » Forms » ora-01002 error
ora-01002 error [message #115972] Fri, 15 April 2005 11:22 Go to next message
skccc
Messages: 3
Registered: April 2005
Junior Member
I've encounter a quite special error in Oracle Form 6.0 and oracle 8i... the case is:
(1) i have a quite long string for query, with 'select from ....' but not insert/delete/update
(2) i need to use DBMS_SQL dynamic cursor to get my desired result
(3) after DBMS_SQL.execute(sumcursor) is run, i get every row by Looping througt the resultset if fetch(sumcursor) > 0;
but now, Ora-01002 occurs when fetching the resultset....it is said from the docs that it may occur when fetching over the last set of cursor, but the fact is that All Above runs Completely smoothly until i changed something in the query string. What's the reason behind? Any solutions to overcome or get around? Coz it sounds so weird.... Thanks!!
ora-01002 error (more info) [message #116038 is a reply to message #115972] Sat, 16 April 2005 11:43 Go to previous messageGo to next message
skccc
Messages: 3
Registered: April 2005
Junior Member
Here is the whole scenario... hope it makes clearer for my problem

The full code is as below..

(*) there are 0 rows returned from the cursor
(*) i've changed a little bit in the query_str

(parse a query_str into DBMS_SQL)
(DBMS_SQL.define_column.... etc stuff)
DBMS_SQL.execute(sumcursor); -- Still ok in here
LOOP
-- system halts in here
IF (DBMS_SQL.fetch(sumcursor) > 0) THEN
(do something)
ELSE
EXIT;
END IF;
Re: ora-01002 error [message #116118 is a reply to message #115972] Sun, 17 April 2005 21:51 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have a look at the problem and answer given in http://www.experts-exchange.com/Databases/Oracle/Q_20293304.html where this failure is due to having a COMMIT in a procedure called by your SQL. They suggest either moving the COMMIT elsewhere or using an 'AUTONOMOUS TRANSACTION'.
Previous Topic: CURSOR STYLE
Next Topic: Help with passing details
Goto Forum:
  


Current Time: Thu Sep 19 22:40:49 CDT 2024