IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQL CODE -301 while trying to Open a Cursor


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Calling an Open C library function in... CICS 1
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top