Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loading more than 1000 columns into memory

sathya_mounikaJul 14 2017 — edited Jul 20 2017

Hi All,

I have a data set with more than 1000 columns in the form of a Select Statement that I am trying to load into memory.

For example below code works.

CREATE OR REPLACE TYPE obj_typ1 AS OBJECT (col1 number, col2 NUMBER);

CREATE OR REPLACE TYPE col_typ1 AS table OF obj_typ1;

DECLARE

var_typ col_typ1;

BEGIN

  SELECT obj_typ1(1,2) INTO var_typ FROM (SELECT 1,2 from dual);

END;

When I increase the number of columns involved to more than 1000, the SELECT INTO fails with ORA--00939 - too many arguments for function ERROR.

CREATE OR REPLACE TYPE obj_typ1 AS OBJECT (col1 number, col2 NUMBER......... col1000 NUMBER);

CREATE OR REPLACE TYPE col_typ1 AS table OF obj_typ1;

DECLARE

var_typ col_typ1;

BEGIN

  SELECT obj_typ1(1,2.....1000) INTO var_typ FROM dual;

END;

This is because when invoking the Type Constructor method the arguments cannot exceed 999 even if the Object type has more than 999 attributes. I will have to try and do a PL/SQL assignment now like

var_typ := col_typ(obj_typ(1,2,...,999,1000));

But my source data set that I want to load into memory is in the form of a Select Statement. Please let me know on how this could be accomplished.

Thanks!

This post has been answered by Stew Ashton on Jul 19 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2017
Added on Jul 14 2017
13 comments
988 views