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
 

 

sql query

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

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Thu Jul 24, 2014 2:19 am    Post subject: sql query
Reply with quote

Hi , this may be a weird thinking ..just want to know tbough...

Select x
Into y
Where x = y

Is this query will work in a sequential manner. Where value of y changes every time

Basically my question is for a table as below

Date amt
1 100
2 100
3 200
4 400
5 400

If I execute

Move 100 to ww-amt

Select amt
Into ww-amt
Where amt = ww-amt
And date > 1


Will this give me Sqlerrd as 4
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Thu Jul 24, 2014 4:20 pm    Post subject: Reply to: sql query
Reply with quote

No replies yet, which means your question was not understood.
Please rephrase, give a better example (1,2,3,4,5 in a date column doesn't look good), give interesting info (ever heard of SQLCODE?) and use code formatting.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Thu Jul 24, 2014 8:58 pm    Post subject: Reply to: sql query
Reply with quote

Quote:
Will this give me Sqlerrd as 4

Why do you think it would? What happened when you tried it? Why would you even want to do this? You might as well say
Code:
WW-AMT = WW-AMT;
(PL/1, Rexx, C etc) or
Code:
MOVE WW-AMT TO WW-AMT
(COBOL - if it allows it)
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1625
Location: NY,USA

PostPosted: Fri Jul 25, 2014 12:25 am    Post subject:
Reply with quote

Quote:
Will this give me Sqlerrd as 4

SQLERRD is an array, so you need to specify the occurance or explain the terminology. However give a try and see what comes out.

Code:
Select amt
Into ww-amt
Where amt = ww-amt
And date > 1


What is the concern with this query? you would still expect for 100?
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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