Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PK via INSERT INTO .. FROM MEMVAR
Message
De
06/08/1998 23:48:40
 
 
À
04/08/1998 15:17:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00123882
Message ID:
00124692
Vues:
15
>>>>>Can I use the INSERT INTO .. FROM MEMVAR and
>>>>>get the proper next primary key as employed in the
>>>>>Tastrade app? The nextid routine works via the
>>>>>INSERT INTO .. VALUES but not from MEMVAR.
>>>>>The uniqueness of the PK is violated that way. I prefer
>>>>>the FROM MEMVAR technique but will have to try
>>>>>something else unless there is a workaround...
>>>>
>>>>It doesn't matter how you insert a record, but it matters what values you are going to use. I believe, that Tastrade uses PK-generated stored procedure value as default, and doesn't include this field in INSERT .... VALUES() list. I guess you can imitate the same thing with MEMVAR but you will have to specify that primary key field will not be included in the list.
>>>
>>>Guess I don't know how to exclude just one field from a MEMVAR list. That
>>>is why I am having the trouble I am having...
>>
>>You could call your GetNextPrimaryKey Function and store it to you m.PrimaryKey right before your Insert Into ... From Memvar
>>
>>HTH
>
>That approach would work, but not the way I'd like it to work.
>I am setting the nextid function as the default value in table designer...


Try
scatter memvar memo fields except pk_fieldname
and then
insert into ...... from memvar

Sarosh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform