PL/SQL (MOSC)

MOSC Banner

Help to make this package work

edited Aug 23, 2014 5:00AM in PL/SQL (MOSC) 7 commentsAnswered

Hello, I would appreciate your help with a PL/SQL package.

I found a type and function definition from a website:

CREATE OR REPLACE TYPE STRING_AGG_TYPE AS OBJECT
    (
       total VARCHAR2(4000),
       STATIC FUNCTION
            ODCIAggregateInitialize(sctx IN OUT string_agg_type )
            RETURN NUMBER,
       MEMBER FUNCTION
           ODCIAggregateIterate(self IN OUT string_agg_type, value IN VARCHAR2 )
           RETURN NUMBER,
       MEMBER FUNCTION
           ODCIAggregateTerminate(self IN string_agg_type, returnValue OUT  varchar2, flags IN number)
           RETURN NUMBER,
      MEMBER FUNCTION
           ODCIAggregateMerge(self IN OUT string_agg_type, ctx2 IN string_agg_type)
           RETURN NUMBER
   );
/


CREATE OR REPLACE TYPE BODY  STRING_AGG_TYPE  IS
  STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT string_agg_type)
    RETURN NUMBER  IS
  BEGIN
      sctx := string_agg_type( null );
      RETURN ODCIConst.Success;
  END;


  MEMBER FUNCTION ODCIAggregateIterate(self IN OUT string_agg_type, value IN varchar2 )
    RETURN NUMBER  IS
  BEGIN
      self.total := self.total || ', '

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center