-
How to load two dimentional data into table
Please advise for workaroud way to load two dimensional data into global temporary table,
The PL/SQL is the script work fine for loading one dimension data.
SQL> CREATE GLOBAL TEMPORARY TABLE t_transaction (c VARCHAR2(4000))
2 ON COMMIT DELETE ROWS;
SQL> CREATE OR REPLACE TYPE LISTOFOBJS AS OBJECT OF (DEPTNO NUMBER(10),DNAME varchar(20), LOC varchar2(10));
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> declare
2 mytype LISTOFOBJS := LISTOFIDS(20,RESEARCH, DALLAS,30, SALES, CHICAGO,40 ,OPERATIONS, BOSTON);
3 begin
4 FOR i IN mytype.FIRST .. mytype.LAST
5 Loop
6 insert into t_transaction values (mytype(i));
7 end loop;
-
U need To create global temporary table with the object data type what u want to insert. Now presently it will work for scalar datatypes
anu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|