Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default values for object-type parameters

Status
Not open for further replies.

cardy

Technical User
Sep 5, 2000
33
GB
If you have a user-defined [object] type as a parameter to a procedure is it possible to assign a default value to that parameter of the return value of a "constructor" method for the user-defined [object] type, e.g.

procedure proc1 ( param1 in user_type default user_type.constructor() );

I know the above doesn't work but is there another way ?

TIA.

Cardy
 
I don't hink so, I think you would have to programaticly cope with it at the start of your code and if it's not initialised then initialise a local variable of the same type and if it is initialised and contains data copy it accross to the local var. It seems that there are lots of restictions like this in oracle 8i
 
Thanks Mike, that's exactly what I had done to get around the problem but it just looks so "in-elegant". Isn't it also annoying that you can't have private functions and variables defined in object types :-( I guess we'll just have to wait for Oracle to embrace OO technology properly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top