Re: Primary Key, Unique Key
Posted in 1998
Now that I understand the differences better, I'm thinking of whether to change
my table schemas to use unique keys rather than primary keys. I came
across the problem of inserting an empty key string into the table using ODBC
calls and the driver comes back to say that I'm inserting a NULL string into
a key field.
However, if I insert directly into the table specifying
insert into table (field1, ....)
values (..., '', .....),it's ok.
Not if I use ODBC calls to bind the empty string as a parameter for inserting.
(specfying that the parameter has 0 length). The problem is I'm not sure if it's
a bug in the ODBC library or the way the ODBC driver interprets the
parameters is so and there's no way I can specify an empty string as a parameter.
(The confusing part is that in the manual, they say it's possible to specify an
empty string as a parameter by specifying 0 length for the parameter).
I checked with INFORMIX support and it seems they don't have a clue either.
Regards,
Wan-Ling