Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Pro*c : insert null integer value in bind variable
Fred <fred_at_cf.fr> wrote in message news:<2002814-174733-108312_at_foorum.com>...
> Hello,
>
> I can't find a way to insert a null integer value in Pro*C :
> eg, 'pid' is an integer, I would want to insert a NULL value, and not 0
>
> EXEC SQL
> INSERT INTO foo(cpt, code, dt, pid)
> VALUES (:cpt, :code, sysdate, :pid);
> EXEC SQL COMMIT;
>
> Thanks in advance.
Fred, can't you just use the NULL keyword in place of :pid? If pid were a varchar2 instead of an integer I know you would just set the indicator variable to -1 so if NULL will not work perhaps a change of the input data type would be a work around. I do not normally write pro*C, but I did manage to produce a couple of working programs a couple years ago and it seems like this is how I handled null inputs.
HTH -- Mark D Powell -- Received on Thu Aug 15 2002 - 08:29:17 CDT
![]() |
![]() |