Re: Pro*cobol Spurious nulls being updated into database

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Fri, 08 Jan 2010 22:54:44 +0100
Message-ID: <4b47a9a9$0$22939$e4fe514c_at_news.xs4all.nl>



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),' ')
> ,HAR_POSJED=:HAR-POSJED
> ,HAR_KESBOY=:HAR-KESBOY
> ,HAR_AMBROJ=:HAR-AMBROJ
> ,HAR_PMBROJ=:HAR-PMBROJ
> ,HAR_STATUS=:HAR-STATUS
> ,HAR_REDBRO=:HAR-REDBRO
> ,HAR_UPDATE=:HAR-UPDATE
> ,HAR_SATMIN=:HAR-SATMIN
> ,HAR_TELLER=:HAR-TELLER
> ,HAR_CEKOVI=:HAR-CEKOVI
> ,HAR_PRTOFF=:HAR-PRTOFF
> WHERE ROWID=:HARDVER-ROWID
> END-EXEC
>
> 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.
>
> TIA
>

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.

Shakespeare Received on Fri Jan 08 2010 - 15:54:44 CST

Original text of this message