>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