Hello,
I have a TOraQuery that is an insert statement with a SQL like this:
Insert into Table
(Column1, Column2, Column3)
values
(:Column1, :Column2, :Column3)
If there are default values for these columns, and I set NULL for one of the binds, then NULL is inserted instead of the default value. Is there a property on TOraParam that I can set so that the default value will be used instead of NULL?
I have discovered that a statement like this will work
Insert into Table
(Column1, Column2, Column3)
values
(DEFAULT, :Column2, :Column3)
but I don't want to have to change the statement for every row that I am inserting - I just want to change bind variable values and/or properties. Thanks,
Bind variables and default values
Re: Bind variables and default values
Hello,
No, if you set the field value explicitly (even NULL), then this value will be inserted, not depending on whether the field has a default value or not. In order to insert default values, this field mustn't be specified in the query.
No, if you set the field value explicitly (even NULL), then this value will be inserted, not depending on whether the field has a default value or not. In order to insert default values, this field mustn't be specified in the query.