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

sql query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1353
Location: Israel

PostPosted: Thu Jul 24, 2014 4:20 pm
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: 2455
Location: Hampshire, UK

PostPosted: Thu Jul 24, 2014 8:58 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Jul 25, 2014 12:25 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top