Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append from Array with default value(primary key)
Message
De
09/10/2003 13:14:30
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/10/2003 13:03:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00837014
Message ID:
00837020
Vues:
33
This message has been marked as a message which has helped to the initial question of the thread.
>I have a table with a primary key index. The default value for the field is a newid() function. I have a local view of the table, and want to append to the view from an array, and I can't get it to work.
>
>If I include the primary key in the array, I get a uniqueness of primary key violation. If I don't include it, I don't get a primary key. I can't get the primary keys before filling the array because it's a SELECT into array.
>
>Can someone help me fix this Catch 22?
>
>Chris.

Chris,
There are multiple ways to workaround. I think array processing is well fast and efficient :
select 0x7FFFFFFF as Pkfield, ... into ... array aRecs
for ix=1 to alen(aRecs,1)
  aRecs[ix,1] = NewID('myTable')
endfor
select myTable
append from array aRecs
PS: You might even make NewID() call part of SQL.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform