Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Abandoning good programming practice?
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
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
Received on Tue Apr 23 2002 - 15:51:49 CDT