Toon posts:

[Oracle9i] Kopieren van kolommen.

Pagina: 1
Acties:

Verwijderd

Topicstarter
Hoi,

Ik heb 2 oracle DBMS 'en (instances) : TESTSID_server1, DWHSID_server1
In TESTSID heb ik een tabel test100 in schema vector staan.
In deze tabel staan 4 kolommen die ik in een andere tabel wil hebben.
Deze tabel is al aangemaakt en heeft ook andere velden als test100.
Behalve dan die 4 kolommen.
Deze tabel staat in de schema CATALOG_ADMIN in een andere instance DWHSID.

Ik kan het programma Oracle Enterprise Manager gebruiken.
Net zo als TOAD 7.6 en FME

Ik heb al een keer geprobeerd om het via de PL/SQL manier te proberen en wel
met het commando COPY.
Het probleem is dat ik tegen een BUG aan loop die tot hedendaags niet opgelost is. En wel met de bugnr. 661700

Dus ik wil van de ene tabel een paar kolommen kopieren naar een andere tabel in een andere instance.

  • rblok
  • Registratie: Juni 2002
  • Laatst online: 04-09 17:48
Where you able to read the bug and use the workaround described in the bug????

Walking on water and developing software from a specification are easy if both are frozen. - Edward V Berard


  • rblok
  • Registratie: Juni 2002
  • Laatst online: 04-09 17:48
Here is the text of the bug:

The CPY-7 means:

00007,0, "Select list has fewer columns than destination table\n"

// *Cause:

// *Action:

.

Problem:

Bug#27365 (Status: 22,Approved for Future Release) was opened for this CPY-7

error and was never solved. We have to copy many tables from Oracle to the

OS/400 site. The error does also occur when the gateway is not involved.

.

Testcase:

Create database link to access to the gateway:

create public database link tgdb2aduer

connect to scott identified by tiger

using 'as400aduer.world';

.

create a temporary table:

create table bectst

(deptno NUMBER,

dname varchar2(14),

loc varchar2(13),

test number);

.

Insert of one row into the temporary table:

insert into bectst values(60,'SUPPORT','BOTTMINGEN',1);

.

Run the copy in sqlplus:

copy from scott/tiger@8041 -

insert scott.dept@tgdb2aduer (deptno,dname) -

using select deptno,dname from bectst;

.

Array fetch/bind size is 15. (arraysize is 15)

Will commit when done. (copycommit is 0)

Maximum long size is 80. (long is 80)

.

CPY0007: Select list has fewer columns than destination table

.

Workaround:

One workaround would be to create a view at the AS/400 site with the

columns which would like to be copied from the local table as follows:

.

declare

num_rows number;

begin

num_rows := dbms_hs_passthrough.execute_immediate@tgdb2aduer

('create view scott.deptv

as

select deptno,dname from scott.dept');

end;

/

.

Run the copy by using the created view:

copy from scott/tiger@8041 -

insert scott.deptv@tgdb2aduer -

using select deptno,dname from bectst;

.

Array fetch/bind size is 15. (arraysize is 15)

Will commit when done. (copycommit is 0)

Maximum long size is 80. (long is 80)

1 rows selected from scott@8041.

1 rows inserted into SCOTT.DEPTV@TGDB2ADUER.

1 rows committed into SCOTT.DEPTV@TGDB2ADUER at DEFAULT HOST connection.

.

Verify the inserted data:

SQL> select * from scott.dept@tgdb2aduer;

.

DEPTNO DNAME LOC

---------- -------------- -------------

10 ACCOUNTING NEW YORK

20 RESEARCH DALLAS

30 OPERATINS BOSTON

40 SALES PARIS

60 SUPPORT

.

The above workaround requires more expenditure therefore a fix in sqlplus of

this CPY-7 is high desirable.

I was also able to reproduce this behaviour on Digital Unix and Windows NT

therefore I open this bug as GENERIC.

Walking on water and developing software from a specification are easy if both are frozen. - Edward V Berard


Verwijderd

Topicstarter
Ik weet dat deze workaround bestaat maar,
dit moet ook veel makkelijker kunnen.
Het is alleen ff een paar kolommen in de juiste volgorde uitlezen en
weer schrijven.
In principe zou ik zelf een vb programma voor dit kunnen schrijven.
Maar als toad het niet eens kan. Ik snap dit niet.

(Waarom dat ik geen programma schrijf is dat het niet mijn werk is.
Deze vraag was een probleem op het werk.)

  • rblok
  • Registratie: Juni 2002
  • Laatst online: 04-09 17:48
Dan zit er niets anders op dan of de workaround gebruiken. 8)7

Of aangeven aan de personen die er wel over gaan dat er een programma voor geschreven moet worden. :*)
Door wie dan ook.....

[ Voor 3% gewijzigd door rblok op 25-11-2003 17:46 ]

Walking on water and developing software from a specification are easy if both are frozen. - Edward V Berard