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 -> UPDATE, Pro C, indicator variable to replace a Null in the table with data

UPDATE, Pro C, indicator variable to replace a Null in the table with data

From: Colgate-Palmolive <ksacher_at_worldnet.att.net>
Date: 1998/05/02
Message-ID: <6idv2i$s9b@bgtnsc01.worldnet.att.net>#1/1

Hello!

I am using the Pro C compiler v2.1.

A table has a field with a NULL value that I wish to update with data.

The flat file is read, and fields from the flat file are are placed into host variables. Each host variable is checked for all blanks. If it is all blanks, it is assumed NULL and the indicator variable,(declared as short) is set to -1. If it is not all blanks, the indicator is set to 0.

If an UPDATE is necessary, the UPDATE is performed using the following syntax:

EXEC SQL UPDATE SAP_MATERIAL_MASTER
SET SAP_MATERIAL_TYPE_CODE =:ov_sap_material:ov_sap_material_ind WHERE SAP_MATERIAL_NUMBER=:ov_sap_material_num:ov_sap_material_num_ind;

SAP_MATERIAL_TYPE_CODE is a foreign key to another table. I have checked the length and displayed the results and the host variable contains valid data.

ORACLE appears to perform the update but the data never appears in the table. There are no oracle error messages.

If I remove the indicator variable on the SET line, the update occurs. Unfortunately this is not a work around because there may be an instance when I need to update the field with a NULL and I will need the indicator variable to do this.

Does anyone have any ideas?????

Thanks,
Katy Sacher
ksacher_at_worldnet.att.net Received on Sat May 02 1998 - 00:00:00 CDT

Original text of this message

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