Pregunta

I have a sales object and a table (tab1) of sales objects. I want to create a second table (tab2) that contains references to the objects in tab1.



    CREATE TYPE sales AS OBJECT
    ( marca NUMBER(4),
      nume VARCHAR2(40),
      orasp VARCHAR2(20),
      nrv NUMBER(4)
    );
    /
    DROP TABLE tab1 CASCADE CONSTRAINTS;
    CREATE TABLE tab1
    (
        vanzator sales
    );

I try to get the object ref, as so but hit the PL/SQL ORA-00904 "p" invalid identifier.

DECLARE
    CURSOR c_pers_ref IS
        SELECT REF (p)
        FROM tab1 p;
    rec_vanz_ref REF t2;

What am I doing wrong? Please help.

¿Fue útil?

Solución

Ok. Got it. When creating tab1 changed the create line to CREATE TABLE tab1 OF sales;

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top