MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sql statement

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
KHerrera
Beginner


Joined: 09 May 2007
Posts: 2
Topics: 1
Location: Mexico

PostPosted: Tue Jun 24, 2008 5:32 pm    Post subject: sql statement Reply with quote

Can someone tell me what the =: statement means in the following line of code ?

WHERE
A.BUS_ASSOC_NBR = :BUS-ASSOC-NBR
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Jun 24, 2008 5:46 pm    Post subject: Reply with quote

KHerrera,

A = table name identified in the FROM clause

BUS_ASSOC_NBR is a column name in that table

:BUS-ASSOC-NBR is working storage host variable , and the value will be populated in it before u execute the query

for ex :
move 11111 to BUS-ASSOC-NBR

this will be treated as


WHERE
A.BUS_ASSOC_NBR = 11111

now you the fetch/select statement will fetch the record with BUS-ASSOC-NBR of 1111.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
KHerrera
Beginner


Joined: 09 May 2007
Posts: 2
Topics: 1
Location: Mexico

PostPosted: Wed Jun 25, 2008 10:47 am    Post subject: Reply with quote

so if i have an input file with 3 fields that i need to match against my table, my where clause will be like this: ?

WHERE
BUS_ASSOC_NBR = :BUS-ASSOC-NBR
OR ORG_NBR = :ORG_NBR
OR CARES_NBR = :CARES_NBR

thanks for your reply ...
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Wed Jun 25, 2008 11:05 am    Post subject: Reply with quote

KHerrera wrote:
so if i have an input file with 3 fields that i need to match against my table, my where clause will be like this: ?

WHERE
BUS_ASSOC_NBR = :BUS-ASSOC-NBR
OR ORG_NBR = :ORG_NBR
OR CARES_NBR = :CARES_NBR

thanks for your reply ...


Maybe OR or maybe AND depending on what you are trying to find.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group