Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Abandoning good programming practice?
Just a guess:
did you try ADDRESS_GENERAL_T.FIRSTNAME%TYPE ?
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "Kurt Laugesen" <kula_at_int.tele.dk> wrote in message news:7c804feb.0204231251.1521c267_at_posting.google.com...Received on Wed Apr 24 2002 - 03:23:19 CDT
> Suppose I have the following (a VERY shortened version):
> CREATE OR REPLACE TYPE ADDRESS_GENERAL_T AS OBJECT (
> FIRSTNAME VARCHAR2(40)
> ,ADDRESS_TYPE VARCHAR2(20),
>
> MEMBER PROCEDURE updateaddress
> (pFirstname VARCHAR2
> ,paddress_type VARCHAR2 default 'STANDARD') ,
>
> STATIC FUNCTION MAKE RETURN ADDRESS_GENERAL_T
> ) not final
> /
> CREATE OR REPLACE TYPE ADDRESS_TABLE_T AS TABLE OF ADDRESS_GENERAL_T
> /
>
> ALTER TABLE LEGAL_PERSON ADD
> (ID NUMBER(9)
> ,ADDRESS ADDRESS_TABLE_T
> ) NESTED TABLE ADDRESS STORE AS ADDRESS_TAB
> /
>
> Suppose I want to expose to the outside world a procedure (in a
> package - goes without saying) that could manipulate firstname in
> legal_person I would normally do something like this:
> PROCEDURE manipulate (
> pId IN LEGAL_PERSON.ID%TYPE
> ,pFirstname IN LEGAL_PERSON.FIRSTNAME%TYPE)
>
> but that of course will not do in this case.
> I tried ADDRESS_TABLE_T.FIRSTNAME%TYPE but this gives an error that
> %TYPE has to be applied to an actual object, so I tried something like
> LEGAL_PERSON.ADDRESS(1).FIRSTNAME%TYPE but no go.
> I could (in a package) declare a (dummy) variable of type
> ADDRESS_GENERAL_T and then write dummy.firstname%type, but that does
> not seem like a good idea.
>
> Do I really have to revert to write like this?:
> PROCEDURE manipulate (
> pId IN LEGAL_PERSON.ID%TYPE
> ,pFirstname IN VARCHAR2)
>
> Regards
> Kurt Laugesen