Results 1 to 2 of 2

Thread: PIPE Function

  1. #1
    Join Date
    Jul 2004
    Posts
    17

    Unanswered: PIPE Function

    Hi Guys,

    Im trying to compile a function and its telling the RETURN variable must be declared. I cant see anything missing in the code but it does use the PIPELINED function which i must confess I have no experience off.

    I have posted the start of the code (rest is irrelevant, I think), if anyone can offer a suggestion it would be greatly appreciated and if you need more code please just shout:

    Error: identifier 'TAB_FACTORY_ACTIVITY_BY_DY' must be declared.
    Code:
    create or replace
    FUNCTION fn_holds_by_day(in_start_dt varchar2, in_end_dt varchar2, in_dy number)
    RETURN tab_factory_activity_by_dy pipelined
    AS
    rec rec_factory_activity_by_dy:= rec_factory_activity_by_dy(null,null,null,null,nul l,null,null,null,null,null,
    null,null,null,null,null,null,null,null,null,null) ;
    TYPE csr IS REF CURSOR;
    v_sql varchar2(4000);
    v_activity_type varchar2(40);
    csr_val csr;
    begin
    v_activity_type := 'HOLDS';
    v_sql:=

    .........
    .........

    OPEN csr_val FOR v_sql using v_activity_type,in_start_dt,in_dy,in_dy,in_dy,
    in_dy,in_dy,in_dy,in_dy,in_start_dt,in_end_dt;
    LOOP
    FETCH csr_val INTO
    rec.fiscal_wk,
    rec.lot_type ,
    rec.prod ,
    rec.waf_size ,
    rec.build ,
    rec.exp_team ,
    rec.priority,
    rec.exp_code,
    rec.dy_1 ,
    rec.dy_2 ,
    rec.dy_3 ,
    rec.dy_4 ,
    rec.dy_5 ,
    rec.dy_6 ,
    rec.dy_7 ,
    rec.weekly_total ,
    rec.weekly_average ,
    rec.activity_type ,
    rec.fac_activity_key ,
    rec.last_updated_dt ;
    EXIT WHEN csr_val%NOTFOUND;
    pipe ROW (rec);
    END LOOP;
    CLOSE csr_val;
    return ;
    end;

  2. #2
    Join Date
    Jul 2004
    Posts
    17
    Its ok I got it sorted - thanks anyway guys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •