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!

Oracle create type table from existing table%rowtype ?

3031421Mar 9 2017 — edited Mar 13 2017

Hi, I'm trying to create a test pipelined table function.  In the first declaration then i am receiving the following error: 

"Identifier LOADER.SD_DIM_DATE must be declared."

How do I create a type based on an existing object, ie a table or cursor?

create type tDateDim AS table of LOADER.SD_DIM_DATE%ROWTYPE;

/

create or replace function tvf_DateDimm

return LOADER.SD_DIM_DATE%ROWTYPE pipelined is

begin

  FOR i in (select * from LOADER.SD_DIM_DATE) loop

    pipe row(I.REPORT_MONTH, I.REPORT_MONTH_DESC)

  end loop;

  return;

end;

This post has been answered by unknown-7404 on Mar 9 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2017
Added on Mar 9 2017
16 comments
6,289 views