Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Strange error on SELECT from TABLE CAST
I cant seem to use SUBSTR() when I'm selecting from a CAST table
object. E.g.
DECLARE
id_list id_tab := id_tab();
v_str VARCHAR2(10);
BEGIN
id_list.EXTEND; id_list(1) := id_row(NULL); id_list(1).id := 'ABCDEFG';
SELECT id INTO v_str
-- SELECT SUBSTR(id,1,2) INTO v_str
FROM TABLE(CAST(id_list AS id_tab));
dbms_output.put_line('id = '||v_str);
END;
/
This works fine and displays "id = ABCDEFG". However, uncomment the SUBSTR line and comment the other, and then I get:
SELECT SUBSTR(id,1,2) INTO v_str
*
ERROR at line 10:
ORA-06550: line 10, column 5: PLS-00801: internal error [22914] ORA-06550: line 10, column 5:
Why cant I use SUBSTR()? I have experimented and seem to be able to use SUM(), but not TO_NUMBER()! This is very irritating, as I need to use SUBSTR() on the column I am selecting...
SQL> select * from v$version;
BANNER
Any help appreciated,
Cheers,
Mark
--Received on Tue Feb 08 2005 - 10:29:55 CST