Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generating Primary key during APPEND FROM
Message
De
08/06/1998 13:42:19
 
 
À
08/06/1998 12:45:13
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00105751
Message ID:
00105948
Vues:
34
I am sorry I meant to say the Table.Valid method. Yes,
you would have to create a stored procedure or UDF
to handle this.

With the triggers you can't update the same table.

-myron kirby-
=================================
>Two things:
>
>One, the triggers take only a single line (command or function call)
>
>Two, even after creating a function to do the replace,
> the call from INSERT corrupted the DBF/DBC connection to the table
> the call from UPDATE had no effect.
>
>If you have any more ideas, let me know
>
>Thanks
>
>Rex
>
>
>
>>I also tested it and was surprised that on the SDF
>>Append with the Fields clause the
>>field default is not firing. I do most of my imports with
>>low level file functions so I have not experienced this.
>>I would think this is a bug and should be reported.
>>
>>As a kludge I had read in a message thread that you
>>can update a field within the Dbc.Table.Update. (I
>>have not tried this.) Maybe you could put something
>>like:
>>
>> IF EMPTY(RecKey)
>> && Either hardcode the field default value method or use
>> && DbcGetProp - field DefaultValue
>> REPLACE RecKey WITH GetKey()
>> ENDIF
>>
>>
>>Again, this is not something I have experimented with.
>>-myron kirby-
>>===========================================
>>>Myron,
>>>
>>>Sorry for the confusion, I am attempting to APPEND from a text file into a table in a database. The id field in the table has a default value set from a function. When APPENDing SDF, the DEFAULT method is not firing, even if I use the FIELDS clause. I know I can append the information into a temp table without the id field and then append from the temp table into the "real" table, but I didn't want to go through the hassle. Any other suggestions???
>>>
>>>Rex
>>>
>>>>It will fire as long as you exclude the primarykey from the source
>>>>file. You could use the Fields option of the Append function and
>>>>not list the key field.
>>>>-myron kirby-
>>>>==============================================
>>>>>Is there a way, using the DBC methods, of generating unique keys for records appended from another file? I am placing a unique key procedure in the DEFAULT method of a field, but it is not being triggered in the APPEND FROM statement.
>>>>>
>>>>>TIA
>>>>>
>>>>>Rex
----------------------------------
-myron kirby (mkirby2000@gmail.com)-
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform