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
 

 

What is sqlcode -317 and how to solve it

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
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    Post subject: What is sqlcode -317 and how to solve it
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: 3158
Location: Tucson AZ

PostPosted: Wed Jun 20, 2007 2:26 pm    Post subject:
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

Site Director


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

PostPosted: Wed Jun 20, 2007 6:24 pm    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Jun 20, 2007 7:11 pm    Post subject: Re: What is sqlcode -317 and how to solve it
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am
No new posts SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm
No new posts SQLCODE -450 for stored procedure spoorni DB2 3 Fri Jan 16, 2015 2:45 am


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