"Chris \( Val \)" <chrisval_at_bigpond.com.au> wrote in message news:<b6c72k$3kn0m$1_at_ID-110726.news.dfncis.de>...
> "Ed Prochak" <edprochak_at_adelphia.net> wrote in message news:3E847FFF.1060607_at_adelphia.net...
> | Chris ( Val ) wrote:
> | > "Chris ( Val )" <chrisval_at_bigpond.com.au> wrote in message
> | > news:b5k1a4$29c3fl$1_at_ID-110726.news.dfncis.de...
> | > | Hi everyone.
> | > |
> | > | I'm not sure if this is allowed, but here is what I'm
> | > | trying to do.
> | > |
> | > | I can create an object type like so:
> | > |
> | > |
> | > | CREATE OR REPLACE TYPE MyType AS OBJECT
> | > | (
> | > | fname VARCHAR2( 30 ),
> | > | lname VARCHAR2( 30 ),
> | > | age NUMBER( 3 )
> | > | );
> | > |
> | > |
> | > | But when I try to create it using the '%TYPE', I
> | > | get the error listed below(after typing show errors),
> | > | but I'm not sure why.
> | > |
> | > |
> | > | CREATE OR REPLACE TYPE MyType AS OBJECT
> | > | (
> | > | fname MyTable.FirstName%TYPE,
> | > | lname MyTable.LastName%TYPE,
> | > | age MyTable.Age%TYPE
> | > | );
> | > |
> | > | Errors for TYPE MYTYPE:
> | > |
> | > | LINE/COL ERROR
> | > | -------- ----------------------------------------------------------
> | > | 0/0 PL/SQL: Compilation unit analysis terminated
> | > | 3/9 PLS-00201: identifier 'MYTABLE.FIRSTNAME' must be declared
> | > |
> | > |
> | > | Can someone advise as to why I can't do this please ?.
> | >
<snip>
>
> A person told me during the week that it was not legal to use
> '%TYPE' in this situation, and this is what I'm not sure about.
>
> Could this be the case ?.
>
> Thanks.
> Chris Val
Yes you can only use %TYPE in PL/SQL not SQL.
Hth
Martin
Received on Tue Apr 01 2003 - 12:16:39 CST