In this post, we will see how to resolve Insert value after default value column in prepare-execute
Question:
I have a table where i am inserting values usingprepare
and execute
statements.trunc(SYSDATE)
for the date
column. I need to pass the values for other 3 columns though execute
statement.I am not sure how to pass the value to
region
after the default date
column using execute
.execute
for date
(something like below)?Best Answer:
The bind variables are being bound to the?
placeholders. It does not matter where they are in the statement or what is between the bind variables within the statements.- The first variable is bound to the first
?
. - The second variable is bound to the second
?
. - The third variable is bound to the third
?
. - Etc.
The Perl code does not need to know about the
INSERT
statement, it just needs to know how many ?
s (anonymous bind variables) there are in the statement and provide one value for each of them.If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com