Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

default column value

Status
Not open for further replies.

FALCONSEYE

Programmer
Jul 30, 2004
1,158
US
You know how we could use:

Code:
  dateStamp DATE DEFAULT sysdate

to assign a default value to a column in table_x. What if I want to assign a default function? Can I do that?

The function will have some values from "table_params" to run some formula including a column named : "base" in table_x.

I could possibly write a cursor to loop through and run an update statement, but I was just curious if this is possible.
thanks in advance.

ColdFusion Ninja for hire.
 
This cannot be done.
Restriction on Default Column Values
A DEFAULT expression cannot contain references to PL/SQL functions or to other columns, the pseudocolumns CURRVAL, NEXTVAL, LEVEL, PRIOR, and ROWNUM, or date constants that are not fully specified.

I am doing an update via a trigger instead. Thanks

ColdFusion Ninja for hire.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top