Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1248
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: 1925
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: 1819
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 How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 0 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 3 Tue Nov 07, 2017 8:34 pm
No new posts Query on XMITIP abdulrafi All Other Mainframe Topics 1 Wed Oct 25, 2017 6:54 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us