Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI string bound to VARCHAR2 - FK constraint failure
Have you tried using indicator variables?
This because the Oracle error you get simply means that the data that you insert does not exist in the parent table. Try using indicator variables, and use them to specify that you are inserting data, not nulls.
Specify the indicator variable(s) in OCIBindByPos and optionally in OCIBindArrayOfStruct (in the case you are doing an array insert). Initialize the indicator varibles to 0, indicating that you are inserting values. If the indicator is set to -1, you tell the OCI to insert o NULL, regardless of the value you assign to the program variable.
By the way, there ARE some bugs in 805, i moved to 815. Cant remember this one however, and i used the same method as you did. But i used indicator variables.
Hope this helps.
Jan-Marten Spit Received on Wed Jan 19 2000 - 03:31:23 CST
![]() |
![]() |