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
 

 

Clarification regarding SYSIBM.SYSDUMMY1 usage

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

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Thu Dec 02, 2010 11:37 am    Post subject: Clarification regarding SYSIBM.SYSDUMMY1 usage
Reply with quote

Hi ,

I came across a query that looks something like below , but i dont know the actual purpose of this , can anyone please explain .

EXEC SQL
DECLARE xxxxxx CURSOR
WITH RETURN
FOR
SELECT -1
FROM SYSIBM.SYSDUMMY1
END-EXEC.
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: Thu Dec 02, 2010 8:43 pm    Post subject:
Reply with quote

Hello,

Without more information, no one here will know the purpose of this query or why it is within a cursor.

The SELECT will return a -1. . .
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Thu Dec 02, 2010 9:46 pm    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Without more information, no one here will know the purpose of this query or why it is within a cursor.

The SELECT will return a -1. . .


sorry i myself don't know the query , some one sent me the question and i posted , the person was more interested in what will that with return option do , followed by a -1.
i will see if i can get more info from the person
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Fri Dec 03, 2010 4:45 pm    Post subject:
Reply with quote

"with return" is used in stored procedures to create result sets.
for a more detailed answer, start reading about stored procedures and result sets.
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: Fri Dec 03, 2010 7:59 pm    Post subject:
Reply with quote

Hello,

One of my clients insists that every query used in MS-SqlServer be placed in a stored procedure. I've not run into this on the mainframe, but it seems to be somewhat common with SqlServer. Might this be the case here also?

I'm probably missing something, but i'm not clear on why the cursor or the "with return".

I suspect there is more not posted code that does this selectively. . . icon_confused.gif
Back to top
View user's profile Send private message
avik1983

New User


Joined: 11 Mar 2010
Posts: 5
Location: Chennai

PostPosted: Fri Dec 10, 2010 3:22 pm    Post subject:
Reply with quote

I hope this is a pure existence check without any condition writen . So it should always return -1

The output row count will be always 1, so i couldn't understand the usage of cursor.
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 Need clarification of VSAM FCT and DF... pkmurali CICS 15 Sun Apr 10, 2016 1:06 am
No new posts How can amount of the Storage Usage b... esduman61 CICS 6 Wed Mar 09, 2016 1:19 pm
No new posts Controlling usage of resources by tasks raja1128 CICS 3 Fri Nov 06, 2015 9:53 am
No new posts TDQ & its usage as ATI akodakka CICS 3 Sat Oct 17, 2015 6:04 pm
No new posts XPED - When command usage anand1204 Compuware & Other Tools 3 Tue Sep 15, 2015 12:50 am


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