Actually, This response was not correct. I was mistaken about using default values with insert into. Bob was right in that you can use stored procedures to set the default value. I was thinking of a particular circumstance I ran into which isn't related to this issue. Sorry. //;/)
Eric K.
>>I think the trigger fires with INSERT INTO but you have to be careful what you are inserting. If you are setting something like a unique primary key the INSERT INTO will err because INSERT INTO has already violated the uniqueness of the field, if, it is not specified in the VALUES list or a memvar. INSERT INTO puts a null value anywhere VALUES is not specified for a field. This why I continue to generate index keys with a global routine .vs a stored procedure.
>>
>
>More missinformation...
>
>I have a file with an ID key that has a default value of newid()... function NEWID is a stored procedure...
>
>I do...
>
>INSERT INTO EEMAST (empnum) values ('12345')
>
>And, after the insert I look around... I find that the ID field has the next id value in it, and my audit log function, called from the trigger, has logged the inserti, including the key value from id.
>
>BOb
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only