Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting reference back after an insert.
Message
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00082474
Message ID:
00082483
Views:
28
>>I am writing my first c/s app using VFP5 and SQL Server 6.5. My problem is this:
>>
>>I want to add, for an example, a new record into my customer table. My fox app contains a remote view containing all fields in the customer table, parameterised so that it fetches back only one record, any record. I then do an INSERT into the view, to insert the basic information, allowing my user to fill in the rest.
>>
>>I do not fill in the cust_id field, as this is automatically populated by SQL Server using IDENTITY. Therefore in my view it is zero (although the record that has just been added on the server has a cust_id). How do I find out the cust_id of the customer that I have just added?
>
>You need to query the server for the global variable
>
>@@identity
>
>Unfortunately this will mean two SQLs for every insert. I always specify what the id should be from the front end myself.
>
>Ian

Hi!
What about = REQUERY() directly after INSERT and m.Cust_Id = ViewName.Cust_id
Marat
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform