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!

insert object into table

federicoAug 26 2014 — edited Aug 27 2014

Hi all,

I would insert my object type into a table without to make the variable name clear.

This is my poor example:

create or replace type MY_TYPE_OBJ as object

(

  val1 number,

  val2 number,

  val3 number

);

/

CREATE TABLE MY_TABLE of MY_TYPE_OBJ;

/

declare

    myType   MY_TYPE_OBJ;

begin

  myType := new MY_TYPE_OBJ(1, 2, 3);

  insert into MY_TABLE values (myType.val1, myType.val2, myType.val3);

 

end;

/

As you can see, on my last procedure, I had to use the insert into statement with val1, val2, val3 filed name.

Is there a faster way to insert an object into a table ? In production environment the object type as almost 100 filed is not so friendly to write each one by one.

Thanks

Federico

This post has been answered by Billy Verreynne on Aug 27 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2014
Added on Aug 26 2014
4 comments
2,798 views