View previous topic :: View next topic
|
Author |
Message |
mainframe_world
New User
Joined: 22 Jan 2010 Posts: 12 Location: delhi
|
|
|
|
Can we compare pic 9(1) PRC_HHC_BIL_TYP with pic x(1) HCFA-TYPE-OF-BILL AND in DB2 query.
HCFA-TYPE-OF-BILL is a host variable.
PRC_HHC_BIL_TYP is a part of the table.
for e.g.
EXEC SQL
SELECT COUNT
INTO:BILL-TYPE-CNT
FROM PRC_HHC_DATA
WHERE PRC_HHC_SITE_ID = :HCFA-SITE-ID AND
PRC_HHC_BIL_TYP = :HCFA-TYPE-OF-BILL AND
PRC_HHC_EFF_CYMD_DT <= :WS-PRC-HHC-TODAY-CYMD
Please provide your inputs, that will be great help for me. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Well... What have you tried? what is the error you are getting? |
|
Back to top |
|
|
mainframe_world
New User
Joined: 22 Jan 2010 Posts: 12 Location: delhi
|
|
|
|
Got -805 for the same. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
no, you did not receive a -805 because of your WHERE clause.
suggest you look-up -805 and then start again.
and
PRC_HHC_BIL_TYP, if it is a column of a DB2 table,
CAN NOT BE 9(1)
no such thing as a db2 column datatype of 9(1). |
|
Back to top |
|
|
haimzeevi
New User
Joined: 01 Mar 2010 Posts: 27 Location: Israel
|
|
|
|
Hi,
1. For the -805 just try to compile & bind your program again. as Dick mentioned, -805 was not caused by the SELECT.
2. General answer to your question, prior to comparison, check the DCLGEN for column's type, then use for your comparison, an intermediate host-variable of the exact same type.
This saves you a lot of head-aches...
Haim Zeevi |
|
Back to top |
|
|
|