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
 

 

SQLCODE -480

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

New User


Joined: 22 Jun 2013
Posts: 3
Location: USA

PostPosted: Sat Jun 29, 2013 1:03 am    Post subject: SQLCODE -480
Reply with quote

I coded a stored procedure (pgm 1) that calls another stored procedure (pgm 2) which creates a result set. When I tested it using IBM Data Studio it works fine, but our .Net developer is getting an SQLCODE -480.

After calling pgm 2, pgm 1 checks the sqlcode.

Then I execute the following:

EXEC SQL
ASSOCIATE RESULT SET LOCATOR (:R-SET-J01)
WITH PROCEDURE :WS-PROGRAM
END-EXEC.

Then I check SQLCODE and I am getting -480.

There's more code that follows to allocate the cursor, etc.. But I'm getting the error after the ASSOCIATE statement.

It works fine when tested via Data Studio. Does anyone have any ideas?
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: Sat Jun 29, 2013 1:12 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Your question is about DB2 LUW, right?

Ours is a mainframe forum and we have very little dialog about DB2 LUW.

See if this helps:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnmcj10/2.1.6.200?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Sat Jun 29, 2013 1:12 am    Post subject:
Reply with quote

SQLCODE -480 indicates that the procedure has not been called since the last commit. Check the value of WS-PROGRAM; ensure that it is exactly the same (including qualification) as the name the procedure is invoked by.
Back to top
View user's profile Send private message
Brian Haas

New User


Joined: 22 Jun 2013
Posts: 3
Location: USA

PostPosted: Sat Jun 29, 2013 1:25 am    Post subject: Reply to: SQLCODE -480
Reply with quote

The value of WS-PROGRAM is exactly the same. And there is no commit in this program.

EXEC SQL
CALL :WS-PROGRAM ( :RTACM20A-NUM-OFFICE
,:RTACM20A-NUM-ACCT
,:RTACM20A-KEY-ACCT
,:RTACM20A-PROCESS-REQ
,:RTACM20A-CDE-SYMBOL
,:RTACM20A-DT2-TRDE-FROM
,:RTACM20A-DT2-TRDE-TO
,:RTACM20A-FIELD-ORDER-BY
,:RTACM20A-ORDER-SEQUENCE
,:RTACM20A-PAGE-REQUEST
,:RTACM20A-SCREEN-ITEMS
,:RTACM20A-PAGE-COUNT-REQUES
,:RTACM20A-CLA-ASSET
,:RTACM20A-RETRN-CODE
,:RTACM20A-RETRN-MSG)
END-EXEC.

....

EXEC SQL
ASSOCIATE RESULT SET LOCATOR (:R-SET-J01)
WITH PROCEDURE :WS-PROGRAM
END-EXEC.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Sat Jun 29, 2013 1:35 am    Post subject:
Reply with quote

Could the commit be implicit rather than explicit? Are the call to the procedure and the ASSOCIATE LOCATOR statement immediately adjacent?
Back to top
View user's profile Send private message
Brian Haas

New User


Joined: 22 Jun 2013
Posts: 3
Location: USA

PostPosted: Sat Jun 29, 2013 1:40 am    Post subject: Reply to: SQLCODE -480
Reply with quote

That's a good question. I was wondering what might cause an implicit commit. For performance testing (I planned to remove this later) I added a statement to get and then display the current timestamp. Would that cause an implicit commit?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Sat Jun 29, 2013 1:58 am    Post subject:
Reply with quote

If you're getting the timestamp by, e.g., SELECT CURRENT TIMESTAMP INTO some-variable FROM SYSIBM.SYSDUMMY1, that wouldn't cause an implicit commit. I'm afraid that you'll need a better DB2 programmer than I.
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 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
No new posts -81 SQLCODE returned when Remote Stor... kameswaramanoj.Akella DB2 1 Wed Dec 03, 2014 5:36 am


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