General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi Cetin,
Thanks for the quick response. I wanted it for a multiuser environment only and I have been having workaround for this by picking up the next number inside the program before sending the SQL statement to insert. I did not like this approach but guess will have to live with it for time being :-)
Thanks once again and regards
Vijay
--------------------------------------------------------------------------------
> Unless what you want need not be sequential you cannot do it in a multiuser
environment with buffered tables. If it's OK to use nonsequential values then create a table to keep track of last given number and increment it in your routine. Check tastrade.app for a sample.
Cetin
--------------------------------------------------------------------------------
>I need help on following:
>
>I have a VFP native database and a table say 'mytable.dbf'. The primary key in mytable is 'pkfield' and of character type. The value for this primary field is to have something like 'YYYY?????' where YYYY should be replaced with the year the user will type and the ????? should be a number automatically calculated.
>
>For example, If I have 10000 records in that table of which 7500 are for the year 1999 and 2500 are for the year 2000. What I need is to have the primary field to have the default value as "199907501" when the user enters the year as 1999 and fill up additional values and save. Same way, it should be "200002501" if the user entered the year as 2000.
>
>I could use the stored procedure for to calculate the next number automatically but my problem is to get the last number for a specific year. Can anyone, please help me in this?
>
>Thanks in advance.
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