I hope you are well.. We are facing problem in Update statement when Function used in Where clause.
Below is the Query.
- Code: Select all
UPDATE FS_FR_HOUSEDOCCHARGES HC
SET HC.IS_VOID = 'Y'
WHERE HC.SLNO = getchgorginalseq('FUSSLC1818475', 9)
AND HC.HOUSEDOCID = 'SLA000000205'
AND ischginvoiced(HC.HOUSEDOCID, HC.SLNO, NULL) = 'N';
Problem with ischginvoiced(HC.HOUSEDOCID, HC.SLNO, NULL) fuction.
Samething works fine for select statement, only works different manner when we use update statement.
Function returns value 'Y' , there is no record with 'N'. but still updates 1 record.
if i change value 'Y' instead of 'N'. it updates no record. but it should update 1 recod..
it works opposite way. but with same where clause condition with select statement it works fine , what we expect.
Please tell me your suggestion.