Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Hi folk's,
How do I insert a NULL value into a date field
Using PHP 4.3.0 with ESQL/C Version 9.50
IDS 7.3.1
/Arthur
sending to informix-list
↪ replying to aeg
Art S. Kagel — — source: Usenet: comp.databases.informix
On Fri, 09 Jul 2004 08:21:52 -0400, aeg wrote:
You use indicator variables. It's just the inverse of checking for NULL
values. Set an indicator to minus one (-1) and attach the indicator to the
corresponding host variable. So:
EXEC SQL BEGIN DECLARE SECTION;
int date_var;
short date_indicator;
...
EXEC SQL END DELARE SECTION;
date_var = 0; /* Does not matter what the value is. */
date_indicator = (short)-1;
EXEC SQL INSERT INTO mytable (date_col, ...) VALUES ( :date_var indicator
date_indicator, ... );
Or using a prepared statement:
EXEC SQL PREPARE ins_stmt FROM
"INSERT INTO mytable (date_col, ...) VALUES (?,...)";
EXEC SQL EXECUTE ins_stmt USING date_var INDICATOR date_ind;
Art S. Kagel
> Hi folk's,
>
> How do I insert a NULL value into a date field Using PHP 4.3.0 with ESQL/C
> Version 9.50
> IDS 7.3.1
>
> /Arthur
>
> sending to informix-list
insert into tab_name(date_field_name) values(NULL)
Nebojsa
On Fri, 9 Jul 2004 14:21:52 +0200, "aeg" <aeg@hiljo.nl> wrote:
>
>
>Hi folk's,
>
>How do I insert a NULL value into a date field
>Using PHP 4.3.0 with ESQL/C Version 9.50
> IDS 7.3.1
>
>/Arthur
>
>sending to informix-list
------------------------------------
Remove spam block (DELETE_) to reply
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.