Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 514855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:34:05+00:00 2026-05-13T07:34:05+00:00

I’ve some prob with the function TABLE in ORACLE. SET SERVEROUTPUT ON SIZE 100000;

  • 0

I’ve some prob with the function TABLE in ORACLE.

SET SERVEROUTPUT ON SIZE 100000;

DECLARE 

int_position NUMBER(20);

TYPE T_REC_EMP IS RECORD (  nameFile VARCHAR2(200) );    

R_EMP T_REC_EMP ; -- variable enregistrement de type T_REC_EMP

TYPE TAB_T_REC_EMP IS TABLE OF T_REC_EMP index by binary_integer ;
t_rec TAB_T_REC_EMP ; -- variable tableau d''enregistrements


PROCEDURE Pc_Insert ( v_value IN VARCHAR2) IS
BEGIN

  if t_rec.exists(t_rec.Last) then
    int_position := t_rec.last;
    int_position := int_position +1;

    t_rec(int_position).nomFichier := v_value;
  else
    t_rec(1).nomFichier :=v_value;
  end if;

END;

FUNCTION calice_ORACLE( n IN NUMBER) RETURN T_REC_EMP  PIPELINED IS

BEGIN

  FOR i in 1 .. n LOOP
    PIPE ROW(t_rec(i));
  END LOOP;

  RETURN;
END;

BEGIN

    Pc_Insert('allo1');
    Pc_Insert('allo2');
    Pc_Insert('allo3');

    SELECT * fROM TABLE(calice_ORACLE(2));

END;
/

I’m some error about function doesn’t support in SQL statement ( I’m on 9i 9.2 vr)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:34:05+00:00Added an answer on May 13, 2026 at 7:34 am

    First of all you can’t pipline assosiative arrays. Check this for more info on collection types. http://www.developer.com/db/article.php/10920_3379271_2/Oracle-Programming-with-PLSQL-Collections.htm

    Second you need to select into or use cursor in pl/sql.

    I wrote some demo code so that you can check a bit how it can work. I am not quite sure what you actually want to do but at least this compiles, which is good.

    create or replace type t_rec_emp as object (namefile varchar2(200));    
    /
    
    create or replace type tab_t_rec_emp is table of t_rec_emp;
    /
    
    create or replace package mydemopack as
        t_rec tab_t_rec_emp := tab_t_rec_emp(); 
        procedure pc_insert ( v_value in varchar2);
        function calice_oracle( n in integer) return tab_t_rec_emp pipelined;
    
    end;
    /
    
    create or replace package body mydemopack as
        procedure pc_insert ( v_value in varchar2) is
        begin
            t_rec.extend(1);
            t_rec(t_rec.count):= t_rec_emp(v_value);
        end;
    
        function calice_oracle( n in integer) return tab_t_rec_emp pipelined is
    
        begin
    
          for i in 1 .. n loop
            pipe row(t_rec(i));
          end loop;
    
          return;
        end;
    end;
    /
    
    
    declare
        cursor c_cur is
            select * from table(myDemoPack.calice_oracle(2));
    begin
    
        myDemoPack.pc_insert('allo1');
        myDemoPack.pc_insert('allo2');
        myDemoPack.pc_insert('allo3');
    
        for rec in c_cur loop
            dbms_output.put_line(rec.namefile);
        end loop;
    
    end;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 372k
  • Answers 372k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I tried to look for such a function in Windows… May 14, 2026 at 7:15 pm
  • Editorial Team
    Editorial Team added an answer OK, I found the answer. Or an answer. Use the… May 14, 2026 at 7:15 pm
  • Editorial Team
    Editorial Team added an answer With respect to the second example, the compiler does not… May 14, 2026 at 7:15 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.