Re: How do I copy records?
Posted in 2000
stumbde <stumbde@email.msn.com> wrote:
>Kristi
>You can unload the data in a flat file using
>unload to table.asc
>select * from table
>where column="001">Open this file in vi editior
>use %s/^001/075/
>Save this file
>Now load this file back using
>load from table.asc
>insert into table
You could also print it out and key them in by hand.
Since Kristi already has a temp table with the data in it, why not just
update temptable
set column = '075'
where column = '001';
Then you can
unload to 'temptable.out'
select * from temptable;
load from 'temptable.out' insert into table;
Then you don't have to mess with vi or sed or awk or keying by hand.....
And if you don't want to mess with the unload, just follow the update with
insert into table
select * from temptable;
>Kristi B <kristi@kaytee.com> wrote in message
>news:8gh1vc$24na$1@razor.dct.com...
>> I'm trying to copy all records where the first field is "001" back into
>the
>> table and changing that field to "075". So, I'll have a duplicate set of
>> records, except for the first field.
>>
>> I'm running 7.24.uc5, Baan IV (mgmt decision).
>> Here are my steps:
>>
>> select * from table
>> where column="001"
>> into temp temptable;>>
>> drop index on table>>
>> insert into table select "075", ?? from temptable>>
>> index table
>>
>> (The ?? is where I get stuck. How do I insert the rest of the columns? Do
>I
>> have to type them all one by one? AND Baan uses hash columns, so the
>second
>> set of data won't insert back into table because sql says there are
>> duplicate values. What do I do with these hashes?)
>>
>> help.
>>
>>
>>
>
>
carlos
Currently on hiatus from unemployment.
----------------------
Do you do Linux? :)
Get your FREE @linuxstart.com email address at: http://www.linuxstart.com