Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedures and Private Datasessions
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00148402
Message ID:
00149265
Views:
29
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
Map
View

Click here to load this message in the networking platform