Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored procedure for default value
Message
De
04/04/2000 12:08:19
 
 
À
04/04/2000 05:04:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00354863
Message ID:
00355018
Vues:
24
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform