how to use the "default value" in oracle
684033Jun 8 2009 — edited Jun 22 2009Hi there. i have a table that has many columns and for most of them, i need to have a default value of 999 set when the user doesn't supply a value. This is how my clients know that this column was skipped by the user in the data entry form.
Using SQL developer as a front end for managing my database, i've specified 999 as my default value.
and i've confirmed that the table does include this by checking the sql that is generated by the system to create the table. These defaults are clearly specified.
However, when I use my windows form to do data entry, for all the fields that i've left blank, the database saved a NULL instead of 999.
I checked the insert statement associated with my table adapter and it lists all columns names, and for the Values() section, it has every column name in the following syntax:
INSERT INTO WTB ("InterviewDate", B7, etc)
VALUES (:InterviewDate, :B7, etc..)
I didn't want to have to write all the logic manually to check for null values... but is that what i have to do?
any help would be appreciated!