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

What is sqlcode -317 and how to solve it


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anant_deshmukh21

New User


Joined: 19 Jun 2007
Posts: 2
Location: pune

PostPosted: Wed Jun 20, 2007 12:20 pm
Reply with quote

plz tell mi what is sqlcode -317 and how to solve it.(DB2)[/b]
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 20, 2007 2:26 pm
Reply with quote

I'd ask if you had looked at the manual, but I couldn't find it either......
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 20, 2007 6:24 pm
Reply with quote

Hello and welcome to the forums,

What version of db2 are you running?

What SQL statement raised the error?

Is the -317 correct or might that be a typo?
Back to top
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Wed Jun 20, 2007 6:47 pm
Reply with quote

HI
I found some info about SQLCODE -317 here is the same This may help you.


SQLCODE -317 -CURSOR cursor-name ERROR: MULTIPLE stmt-type
STATEMENTS ATTEMPTED

Explanation: Only one UPDATE statement and one DELETE statement may be coded on a single cursor. The stmt-type field in the message is either UPDATE or DELETE.

The SQLSTATE that equates to this SQL return code is 24S04.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 20, 2007 6:50 pm
Reply with quote

while posting query please preview the same and check whether you have posted what you wanted to and no typo is entered. I could not find any mention of SQLCODE -317 anywhere, which confirms that there is a typo in your query. Please find the sqlcodes in the range of -300 to -400 below.Hope you will find your answer here.

-300 THE STRING CONTAINED IN HOST VARIABLE OR PARAMETER position-number IS NOT NUL-TERMINATED
-301 THE VALUE OF INPUT HOST VARIABLE OR PARAMETER NUMBER position-number CANNOT BE USED AS SPECIFIED BECAUSE OF ITS DATA TYPE
-302 THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE
-303 A VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER position-number BECAUSE THE DATA TYPES ARE NOT COMPARABLE
-304 A VALUE WITH DATA TYPE data-type1 CANNOT BE ASSIGNED TO A HOST VARIABLE BECAUSE THE VALUE IS NOT WITHIN THE RANGE OF THE HOST VARIABLE IN POSITION position-number WITH DATA TYPE data-type2
-305 THE NULL VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER position-number BECAUSE NO INDICATOR VARIABLE IS SPECIFIED
-309 A PREDICATE IS INVALID BECAUSE A REFERENCED HOST VARIABLE HAS THE NULL VALUE
-310 DECIMAL HOST VARIABLE OR PARAMETER number CONTAINS NON DECIMAL DATA.
-311 THE LENGTH OF INPUT HOST VARIABLE NUMBER position-number IS NEGATIVE OR GREATER THAN THE MAXIMUM
-312 UNDEFINED OR UNUSABLE HOST VARIABLE variable-name
-313 THE NUMBER OF HOST VARIABLES SPECIFIED IS NOT EQUAL TO THE NUMBER OF PARAMETER MARKERS
-314 THE STATEMENT CONTAINS AN AMBIGUOUS HOST VARIABLE REFERENCE
-330 A STRING CANNOT BE USED BECAUSE IT CANNOT BE TRANSLATED. REASON reason-code, CHARACTER code-point, HOST VARIABLE position-number
-331 A STRING CANNOT BE ASSIGNED TO A HOST VARIABLE BECAUSE IT CANNOT BE TRANSLATED. REASON reason-code, CHARACTER code-point, POSITION position-number
-332 SYSSTRINGS DOES NOT DEFINE A TRANSLATION FROM CCSID ccsid TO ccsid
-333 THE SUBTYPE OF A STRING VARIABLE IS NOT THE SAME AS THE SUBTYPE KNOWN AT BIND TIME AND THE DIFFERENCE CANNOT BE RESOLVED BY TRANSLATION
-338 AN ON CLAUSE IS INVALID
-339 THE SQL STATEMENT CANNOT BE EXECUTED FROM AN ASCII BASED DRDA APPLICATION REQUESTOR TO A V2R2 DB2 SUBSYSTEM
-351 AN UNSUPPORTED SQLTYPE WAS ENCOUNTERED IN POSITION "" ON A PREPARE or DESCRIBE OPERATION
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Jun 20, 2007 7:11 pm
Reply with quote

Quote:
found some info about SQLCODE -317 here is the same This may help you.


please, so that we can be enlightened, post the link where You found that info

I searched the manual "DB2 UDB for z/OS V8 Codes" but could not find any info related to sqlcode -317 nor sqlstate 24S04
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jun 21, 2007 2:41 pm
Reply with quote

Santosh,

Did you find this in quick reference or elsewhere. Please do let us know as we could not get a single hit with this code or state
Back to top
View user's profile Send private message
ajinth_c

New User


Joined: 11 May 2007
Posts: 4
Location: Bangalore

PostPosted: Wed Jun 27, 2007 10:53 am
Reply with quote

Hi Ananth ,
I just tried to do a quick reference and found the reason for an SQLCODE of -317

*************************************************************************
>>>>>>>>> Multiple item definitions exist for this item <<<<<<<<<
*****************************************************************************
317 SQLCODE -317 -CURSOR cursor-name ERROR: MULTIPLE stmt-type
STATEMENTS ATTEMPTED

Explanation: Only one UPDATE statement and one DELETE statement may be
coded on a single cursor. The stmt-type field in the message is either
UPDATE or DELETE.

The SQLSTATE that equates to this SQL return code is 24S04.

User Response: Remove the extra UPDATE or DELETE statement.
*****************************************************************************
>>>>>>>>> Multiple item definitions exist for this item <<<<<<<<<
*****************************************************************************
317 SQLCODE -317 (alternate version) -CURSOR REQUIRED

ERROR: CURSOR REQUIRED FOR NON-DYNAMIC SELECT

Explanation: Non-dynamic SELECT statements must be embedded in a
DECLARE CURSOR statement.

User Response: Embed the SELECT in a DECLARE CURSOR statement.


If u can cut and paste the excact portion of the code where you get this error code then I think we should be able to trace the problem .

Cheers,
Ajinth
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 -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts how to solve this power failure shutd... ABENDS & Debugging 5
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts SQLCODE = -16002 when using XMLEXISTS DB2 1
No new posts Any idea about how to solve 3022 aben... IMS DB/DC 3
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
Search our Forums:

Back to Top