Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> query works in sqlplus but not in rel dbi

query works in sqlplus but not in rel dbi

From: Sławomir Marcinkowski <s.marcinkowski_at_Bankier.pl>
Date: Thu, 3 Jan 2002 15:15:02 +0100
Message-ID: <a11p1d$jat$1@news.tpi.pl>


select tag_id from TABLE(articles.art_admin.get_tags(211171));

When I call this query from sqlplus its works fine, but if i call it from perl dbi, I get message like this: DBD::Oracle::db selectall_arrayref failed: ORA-22905: cannot access rows from a non-nested table item (DBD ERROR: OCIStmtExecute/Describe)

What should I do to perl could work with function like that?

Slawek Marcinkowski

Function get_tags i defined as:

    FUNCTION get_tags(art_id IN NUMBER) RETURN ZbiorTagow PIPELINED IS

        TYPE RefCurTyp IS REF CURSOR;
        cv RefCurTyp;
        out_rec ObiektTag := ObiektTag(NULL,NULL,NULL);
        tag_id NUMBER;
        name VARCHAR2(65);
        far_id NUMBER;
        get_name VARCHAR2(4000);
    BEGIN
        OPEN cv FOR
            'select ai.id,name,far_id,get_name from articles.art_instrument
ai, '
            || 'articles.instrument_type it where article_id = :p1 and
instrument_type=it.id'
            || ' ORDER BY ai.id '
        USING art_id;
        LOOP
          FETCH cv INTO tag_id,name,far_id,get_name;
          EXIT WHEN cv%NOTFOUND;
          out_rec.tag_id := tag_id;
          out_rec.name := name;
          out_rec.far_id := far_id;
          PIPE ROW(out_rec);
        END LOOP;
      CLOSE cv;
      RETURN;

    END get_tags; Received on Thu Jan 03 2002 - 08:15:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US