Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQL CODE -301 while trying to Open a Cursor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Thu Aug 02, 2007 9:16 am    Post subject: SQL CODE -301 while trying to Open a Cursor
Reply with quote

Hi All,

When I try to open a cursor I get -301 SQL Code.
I checked and the data types of the variables are correct.

Could you please let me know what could be the issue and what could be the resolution ?

Thanks
-Neelesh
Back to top
View user's profile Send private message

Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Thu Aug 02, 2007 10:55 am    Post subject:
Reply with quote

Hai,

I think error in your table variables position. The input host variables in the SQLDA entry number indicate by position numbers.

Are you working in COBOL or PL/1?




Regards
Rajesh S
Back to top
View user's profile Send private message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Thu Aug 02, 2007 10:59 am    Post subject: Re: SQL CODE -301 while trying to Open a Cursor
Reply with quote

Hi rajesh,

Thanks
I am working on COBOL.

Thanks
-Neelesh
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Thu Aug 02, 2007 12:25 pm    Post subject:
Reply with quote

Hai Neelesh,

I'm not able to guess. From where you getting this error. With out known your codings....

Try to explain clearly
Back to top
View user's profile Send private message
Suryanarayana.tadala

New User


Joined: 03 Nov 2005
Posts: 43
Location: St.Louis

PostPosted: Fri Aug 03, 2007 12:26 am    Post subject:
Reply with quote

Could you please post the cursor and the scenario under which you are using this cursor.


Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 03, 2007 1:09 am    Post subject:
Reply with quote

The only variables at issue with the OPEN CURSOR statement are in the WHERE clause of the DECLARE CURSOR.

The host receiving variables are in the FETCH CURSOR statement, which has not been executed, and not in the DECLARE CURSOR statement.

So, find the host variables and/or literals in the WHERE clause are not correct - datatype, usage, etc...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us