Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Null values to DB causes integrity error. (Pro *C)

Re: Null values to DB causes integrity error. (Pro *C)

From: Ron Harvey <rbharvey_at_worldnet.att.net>
Date: 1998/04/03
Message-ID: <3525b7d9.0@news2.uswest.net>#1/1

When inserting null values into a table using ProC you have to use indicator variables set to -1 for the column that is null. Indicator variables need to be bind variables declared as short. For example to insert a name that is null you might have the following in your declare section:

VARCHAR(20) sName;
short iName;

then in your insert you would do the following after setting the value of iName to -1:

Insert into table ... :sName:iName
Good Luck

Colgate-Palmolive wrote in message <6g1ola$t16_at_bgtnsc02.worldnet.att.net>...
>Hello All,
>
>We are currently extracting data from a flat file to an Oracle 7 database.
>A record is read from the file, and the data is stored in several variables
>by field. (Using ProC V2)
>
>A SELECT is performed.
>
>If the record exists in the Oracle database, but needs to be updated an
>INSERT is performed. If one of the update fields is NULL, because there was
>no data in the
>flat file, an error is returned that the update is causing a data integrity
>error.
>
>The field being updated does not have any default criteria. The parameter
>NOT NULL is NOT defined for this field.
>
>However it is possible to update this record by using SQL PLUS and the
>Select Into manually. SELECT ACCOUNT SET AMOUNT = ' ' WHERE ID = 100.
>or
> SELECT ACCOUNT SET AMOUNT = NULL WHERE ID = 100.
>
>Any ideas?? Thanks!
Received on Fri Apr 03 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US