Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> query works in sqlplus but not in rel dbi
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;