Bind variables and default values
Posted: Wed 05 Aug 2015 14:06
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,
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,