Re: Pro*cobol Spurious nulls being updated into database
Date: Fri, 8 Jan 2010 22:27:30 -0000
"Shakespeare" <whatsin_at_xs4all.nl> wrote in message
> Op 8-1-2010 22:04, Steve Rainbird schreef:
>> I have a strange issue which I will probably report as a bug but thought
>> i would pass by you guys 1st.
>> I have an update statement
>> EXEC SQL UPDATE HARDVER SET
>> HAR_IMEPRT=NVL(RTRIM(:HAR-IMEPRT),' ')
>> ,HAR_IMETER=NVL(RTRIM(:HAR-IMETER),' ')
>> ,HAR_WINDOW=NVL(RTRIM(:HAR-WINDOW),' ')
>> ,HAR_TIPTER=NVL(RTRIM(:HAR-TIPTER),' ')
>> ,HAR_TIPPRT=NVL(RTRIM(:HAR-TIPPRT),' ')
>> ,HAR_CEKPRT=NVL(RTRIM(:HAR-CEKPRT),' ')
>> ,HAR_MJESTO=NVL(RTRIM(:HAR-MJESTO),' ')
>> ,HAR_TELBRO=NVL(RTRIM(:HAR-TELBRO),' ')
>> ,HAR_PORUKA=NVL(RTRIM(:HAR-PORUKA),' ')
>> WHERE ROWID=:HARDVER-ROWID
>> All of the host variables have values in them.
>> For some reason HAR_PMBROJ is being updated with a null even thougth
>> HAR-PMBROJ contains 84.
>> If I comment out one of the assignments above HAR_PMBROJ then HAR_PMBROJ
>> is ok but the next column in the update statement HAR_STATUS gets a
>> null. If I comment out 2 of the assignments above HAR_PMBROJ then
>> HAR_REDBRO gets a null.
>> This is very strange and I have no idea why it is happening.
> What happens if you put NVL's around all the assignments? (Or at least the
> first 4 or 5?)
> This can determine whether the error is in the update or in reading the
> host variables.
If I put NVL around all the numeric fields then HAR_PMBROJ gets updated with zero (HAR-PMBROJ contains 84).
-- SteveReceived on Fri Jan 08 2010 - 16:27:30 CST