473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to call to procedure without Cursor giving me a Statement Handle Error?

I have a a Procedure that invokes another procedure that returns a cursor. When I get to the FETCH Statement I get the following Error:

ORA-24338: statement handle not executed
ORA-06512: at "DATATRAN.PRC_STATASCIREPORT", line 31
ORA-06512: at line 2

It is something probably so simple but I have been struggling with this for quit sometime so now I am reaching out for help.
Thanks
S

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE PROCEDURE datatran.prc_statascireport
  2. AS
  3. cur_time VARCHAR2 (10) := TO_CHAR (SYSDATE, 'HH12:MI:SS');
  4. ERROR_CODE NUMBER;
  5. error_msg VARCHAR2 (300);
  6. sql_stm VARCHAR2 (1000);
  7. refcsr sys_refcursor;
  8.  
  9. TYPE recorg IS RECORD (
  10. idnumber VARCHAR2 (3 BYTE),
  11. loanofficer1 VARCHAR2 (3 BYTE),
  12. loanofficer2 VARCHAR2 (3 BYTE),
  13. loannum VARCHAR2 (5 BYTE),
  14. billcycle VARCHAR2 (1 BYTE),
  15. accrint NUMBER,
  16. earnstatus VARCHAR2 (1 BYTE),
  17. nonearningtype VARCHAR2 (3 BYTE),
  18. accrfloat NUMBER,
  19. futureddacharge NUMBER,
  20. accrfees NUMBER,
  21. earnstatus1 VARCHAR2 (1 BYTE)
  22. );
  23.  
  24. TYPE taborg IS TABLE OF recorg;
  25.  
  26. ltab taborg;
  27. BEGIN
  28. nela.pkg_aiagerp.sp_get_aiagerptdata@stnelapd ('A00', 'ZZZ', refcsr);
  29.  
  30. LOOP
  31. FETCH refcsr
  32. BULK COLLECT INTO ltab;
  33.  
  34. FOR i IN 1 .. ltab.COUNT
  35. LOOP
  36. DBMS_OUTPUT.put_line (ltab(i).idnumber);
  37. END LOOP;
  38. END LOOP;
  39.  
  40. END;
Dec 7 '10 #1
1 3331
amitpatel66
2,367 Expert 2GB
You cannot use a REF CURSOR that way by invoking a procedure remotely using a DBLINK.

Check Restrictions on Cursor Variables
Dec 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: serge | last post by:
I am a little confused. If i have an SP like: CREATE PROCEDURE ABC (IN ID Integer, OUT TEST1 Integer, OUT TEST2 Integer) .... How do you call this SP? CALL ABC(varID, varTEST1, varTEST2);
2
by: Schorschi | last post by:
Can't seemd to get ReadFile API to work! Returns invalid handle error? =========================================================================== Ok, the visual basic gurus, help! The...
13
by: Marcin Wasilewski | last post by:
Hi, How to call procedure, which is on SQL Server from Access using visual basic? Thanks, mw
3
by: Marcin Wasilewski | last post by:
Hi, I have a problem with calling procedure with parametrs. After run this code: .... Set strCommand = New ADODB.Command strCommand.ActiveConnection = cnn strCommand.CommandText =...
1
by: simonZ | last post by:
How can I call sub from aspx page? If I have on aspx page grid view and I call procedure from item Template: <asp:GridView ... .... <ItemTemplate> <%# test()%> and in code behind:...
7
by: Ryan | last post by:
I'm creating a user control that has a handful of controls on it (19 in total). One of the controls on the UC is a textbox for a user's password, so I've set the PasswordChar property to "*". I...
1
by: sranger | last post by:
When I try to use a System.IO.Ports.SerialPort object to read from a serial port, half of the time I have no problems. However, after I successfully read from the serial port, then close the...
4
by: gregpinero | last post by:
It's the strangest thing, I'm pulling some text out of a MySQL table and trying to run exec on it, and it keeps giving me a syntax error, always at the end of the first line. Thanks in advance...
1
by: rick | last post by:
Hi I m facing a weird problem when i m executing a procedure with different IDs, The procedure has a select statement , and a codition. when the conditon is met an update statement is ran to...
3
by: shalskedar | last post by:
In my Db i need to update 3 columns..Below is my code to update but giving me an error...Can anyone Plz help me with this... str = "update set .='" & UserForm1.TextBox2.Text &...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.