Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Next Number generator
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00533898
Message ID:
00534889
Views:
32
You don't need it in Oracle because it has a built-in database object that generates a series of unique integers called sequence. Sequences are typically used to generate data values that are required to be unique, such as primary key values.

>Hi!
>
>With ORACLE this will not work. I would recommend you to make a SP in the database and call it from the code. When you move to another type of database server, you will just change that SP. Anyway, the best way to return new value in such case will be the OUTPUT parameter of the stored procedure, because different srver return results from SP by different way. In VFP help you can read samples how to get output parameter value at VFP side using SQLEXEC function.
>
>>Hi micheal,
>>
>>Just wondering ; is this 'SQL server' code or still standard SQL code ? In other words, will this work on other databases ?
>>
>>>There's a cleaner way. You can use UPDATE to increment and fetch the value without have to explicitly manage the locks:
>>>
>>>UPDATE id
>>>SET @nnid = idval, idval = idval + 1
>>>WHERE keyname = @tcKeyWord
>>>
>>>-Mike
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform