Subject | Detecting default values |
---|---|
Author | Tetram Corp |
Post date | 2011-11-03T18:04:47Z |
Hi,
I have a table with a field for which i need a default value. My problem
is the default value can change at any time. So the solution I found is
to use a "before insert" trigger.
But now, i'm facing a new challenge: how to detect if the null status I
received in new.myfield is because the field was not in the insert
statement or because the insert statement set it to null ?
well, from
insert into mytable (field1) values (:field1)
or from
insert into mytable (field1, myfield) values (:field1, null)
I have a table with a field for which i need a default value. My problem
is the default value can change at any time. So the solution I found is
to use a "before insert" trigger.
But now, i'm facing a new challenge: how to detect if the null status I
received in new.myfield is because the field was not in the insert
statement or because the insert statement set it to null ?
well, from
insert into mytable (field1) values (:field1)
or from
insert into mytable (field1, myfield) values (:field1, null)