Advertisement

01.16.2007 at 01:09PM PST, ID: 22124872
[x]
Attachment Details

Fetch a tables into an object and use it in a package

Asked by sval1411 in Oracle Database

Tags: fetch, arguments, default, incorrect, object

Hi, I need to collecting data from a tables into a pl/sql object  using BULK COLLECT, and then querying that object for further processing.
I have created an object and a package wich uses the object.  

CREATE OR REPLACE TYPE OBJ_typ AS OBJECT
(  C1 VARCHAR2(255),
  c2 number(5),
  c3 varchar2(200)
)/

CREATE OR REPLACE TYPE Obj_typ_tbl AS table OF  OBJ_typ;/

CREATE OR REPLACE PACKAGE BODY PKG_using_obj AS
   FUNCTION FN_using_obj
(P_nbr in number
) return Obj_typ_tbl is
      V_emp  Obj_typ_tbl := Obj_typ_tbl();
 begin
      select  OBJ_typ (emp.c1,emp.c2,emp,c3)
     bulk collect into V_emp from
       table(cast( V_emp  as Obj_typ_tbl )) tbl,
        emp_tbl emp where emp.c1 = p_nbr ;  
 
   EXCEPTION       
     WHEN OTHERS THEN
       RAISE;
END FN_using_obj;

END PKG_using_obj ;
/

There error I get is "PL/SQL: ORA-02315: incorrect number of arguments for default constructor".
Can someone let me know where I am going wrong with my code.
Start Free Trial
 
Loading Advertisement...
 
[+][-]01.16.2007 at 01:35PM PST, ID: 18327770

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.16.2007 at 02:48PM PST, ID: 18328374

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle Database
Tags: fetch, arguments, default, incorrect, object
Sign Up Now!
Solution Provided By: ishando
Participating Experts: 2
Solution Grade: B
 
 
[+][-]01.16.2007 at 06:11PM PST, ID: 18329414

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.16.2007 at 07:02PM PST, ID: 18329611

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.17.2007 at 11:33AM PST, ID: 18335128

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32