General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>>>Thanks Trey
>It won't get called twice. Since the p_ticket field in the inserted record in the view already has a value, the default of the p_ticket in the table won't fire when the view is updated.
>If you don't believe me, try it and see :)
It does seem to be firing twice Trey.
I think this is because the insert command first inserts a blank record before doing the rest of the insert.
Maybe I could alter my nextkey routine so that it does not set the primary key value unless the current value is 0.
This would stop it overwriting the first primary key generated when the nextkey runs for the second time.
here is my code. I have put a WAIT WINDOW in NEXTKEY routine as well so that I can see it firing.
sele v_ticket
DBSetProp("v_ticket.p_ticket", "Field", "Default", "NextKey('P_TICKET')")
insert into v_ticket (ticket) values (myvalue)
go recno()
wait window ' v_ticket '+trans(v_ticket.p_ticket)+' ticket '+trans(ticket.p_ticket)
return v_ticket.p_ticket
I am getting a bit desperate on this one so any and all help most greatfully receievd.
Previous
Next
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