Subject | Re: [ib-support] Is this worth to suggest? |
---|---|
Author | Daniel Rail |
Post date | 2002-04-07T13:11:40Z |
At 07/04/2002 08:16 AM, you wrote:
creation. And, for updating a field AFTER UPDATE, use a trigger. I don't
see the reason why you need the update constraint, when triggers exists to
perform the same task.
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)
>Hi,DEFAULT constraints already exists to put default values in fields upon
>
>As I was converting my application to FB1, and I wonder if we could
>suggest a feature to FireBird.
>
>I often need to place the Inclusion date, the user who included, the last
>update date, and the user
>who made the last update into some key structures of the database.
>Well, I am doing this today using triggers. I was hoping to have a
>"declarative" way of doing that.
>
>For example, the 'INSERT' part can be handled using the DEFAULT keyword
>when declaring the field.
>How about a keyword to update a field when the record is updated for example:
>
>
>create table Employee(
> EmployeeID integer primary key,
> DateInsert date default current_date,
> UserInsert varchar(20) default username,
> Address varchar(60),
> Phone varchar(22),
> LastUpdate date when update default current_timestamp,
> UserUpdate varchar(20) when update default username
>);
>
>When the a new record is posted DateInsert, UserInsertm LastUpdate,
>UserUpdate would be updated.
>After that only LastUpdate and userUpdate would be updated.
>
>Is this worth a suggestion to FB?
creation. And, for updating a field AFTER UPDATE, use a trigger. I don't
see the reason why you need the update constraint, when triggers exists to
perform the same task.
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)