Hi!
Assuming you use SQL Server once you mentioned the identity column.
The approach is simple - use the stored procedure and a table that holds the last ID number for each table. Stored procedure gets 2 parameters - table name and output parameter - the next ID number. Call that SP using SQLEXEC() function for which you get the SQL handle from the view using CursorGetProp("ConnectHandle") function. The command for that SQLEXEC is "EXEC" for mentioned stored procedure with use of appropriate table name and "?" for returning result of SP in output paraeter. In the stored procedure just use the single UPDATE command like described in the Thread #
533898 Message #
534192 (id is a table, KeyName is a table name).
It is recommended also to read that thread completely for better understanding from the SQl Server point of view.
HTH.
>Hi,
>
>I have a multiuser application, and some table have a numeric field that must be incremented before the TableUpdate.
>this field can´t be an identity column, so i have to find the last number in the table to replace this field with the new number before the tableupdate. How can I do this operation and without that another user can insert a new record with the same number.
>
>I`m using Remote Views and manual transactions.
>
>Thanks,
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.