Re: ESQL/C with system descriptor area
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
In article <3316EEC5.4987@sni.de>, Peter Elfers <elfers.pad@sni.de> wrote: >Hi, >I want to do Updates and Inserts with an ESQL/C-program on several > tables by using the system-descriptor area. >I store type, length, indicator and data in the descriptor area and > execute the update or insert command. >Everthing works, but when I want to set a column to NULL and set the >indicator to -1, it doesn't work. After the update the column doesn't >contain NULL. > >How can I put NULL into the columns? > >Franz-Josef Stiens >Siemens Business Services IS 73 I had the same problem a few months ago. I opened a case with Tech Support and their reponse was that when you set INDICATOR = -1 you also must not set DATA. This is actually documented in the SET DESCRIPTOR section of the Informix Guide to SQL Syntax manual. If you only read the ESQL/C manual you'll get the mistaken impression that setting INDICATOR = -1 is all that's required. In fact in my 7.1 version of the ESQL/C manual page 10-33 says that when the INDICATOR is set to -1 it means that "The DATA field contains null data". Well, that's plain wrong. You must *not set* the DATA field. I found it easier to ignore INDICATOR and to use rsetnull() to set my host variable value to NULL. -- -- Greg C. Faulk Database Administrator TRW Enterprise Solutions Phone: (510) 645-3655 300 Lakeside Drive Fax: (510) 645-3020