Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding CursorAdapter methods
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01475311
Message ID:
01475322
Vues:
39
>>>>Here Alexey just use DATASOURCE_ASSIGN to create a temporary SP in the SQL Server named #Get_ValHelper.
>>>
>>>Then, do you I understand correctly that without creating this temporary SP, the code in BeforeInsert won't work?
>>
>>It would not work, but you can create a permanent sp with the similar code and call it instead. The only purpose of this temp SP is to return the passed value back as output parameter. It's too tricky, but I tried to change InsertCmd directly to simply append select scope_indentity() (as we do in ASP.NET) and it didn't work.
>>
>>But may be using Stored procedure for InsertCmd that will return new ID will work?
>
>Thank you. I would prefer not to add the code DATASOURCE_ASSIGN (just does not feel right; does not mean it is not right). And your suggestion to create a permanent SP is not a bad idea. I wish, as you already tried, that the setting of the identity column could be done right in the InsertCmd though.

I haven't tried, but I suggest you to try creating an SP that will do your insert and return ID (unless, of course, you generate this insert command on the fly in CA itself).
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform