View previous topic :: View next topic |
Author |
Message |
KHerrera Beginner

Joined: 09 May 2007 Posts: 2 Topics: 1 Location: Mexico
|
Posted: Tue Jun 24, 2008 5:32 pm Post subject: sql statement |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Jun 24, 2008 5:46 pm Post subject: |
|
|
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 |
|
 |
KHerrera Beginner

Joined: 09 May 2007 Posts: 2 Topics: 1 Location: Mexico
|
Posted: Wed Jun 25, 2008 10:47 am Post subject: |
|
|
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 |
|
 |
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Wed Jun 25, 2008 11:05 am Post subject: |
|
|
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 |
|
 |
|
|