troubleshooting Question

Oracle create type table from existing table%rowtype ?

Avatar of Scarlett72
Scarlett72 asked on
Oracle Database
6 Comments1 Solution2825 ViewsLast Modified:
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;
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros