Hi
Having an issue with above. I am trying to copy a record from a table to a TEMP table with a new primary key (document id). Then I'm trying to copy the record back from the TEMP table to the original table, only with a new document ID. sort of like copying an SOP order.... code is below, can anyone tell me what I'm doing wrong or if there is a better way I should be approaching this? I can see the data in the table buffer when I run the code, but the code won't create the new record for me in the SQL database....Thanks in advance! Aaron
set 'Document ID' of table ONE to 'Document ID';
get table ONE;
if err() = OKAY then
{create the TEMP table}
set 'Document ID' of table ONE_TEMP to 'Document ID' {this is the new document id}
release table ONE_TEMP;
change table ONE_TEMP by ONE_TEMP_KEY1;
if err() = OKAY then
copy from table ONE to table ONE_TEMP;
save table ONE_TEMP;
end if;
end if;
{create the new record in the table and copy from temp}
set 'Document ID' of table ONE to 'Document ID' {new Document ID}
release table ONE;
change table ONE by ONE_KEY1;
if err() = OKAY then
copy from table ONE_TEMP to table ONE;
save table ONE;
end if;
*This post is locked for comments
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156