Mark_Co
asked on
User defined records and how to declare in spec as well as body
If I have a record declared in the body of my package for the purposes of passing records instead of variables as parameters, must I also declare the record in the spec. I seem to be getting an error that makes me believe that I need to declare it in the spec as well as the body.
The error was PLS-00201. params_rec must be declared
my record in the body is this:
must it also go in the spec? Things don't need to be declared in the spec unless I want them public right?
This is from the SPEC and is the procedure I want to pass the record variables to:
The error was PLS-00201. params_rec must be declared
my record in the body is this:
TYPE PARAMS_REC IS RECORD(
P_SCHEMA VARCHAR2(4000)
,P_TABLENAME VARCHAR2(4000)
,P_QUERY VARCHAR2(4000)
,P_LOGGING_Y_N VARCHAR2(1)
,P_COMPRESS_Y_N VARCHAR2(1)
,P_TABLESPACE VARCHAR2(4000));
must it also go in the spec? Things don't need to be declared in the spec unless I want them public right?
This is from the SPEC and is the procedure I want to pass the record variables to:
PROCEDURE DROP_TABLES
(
/*P_SCHEMA VARCHAR2
,P_TABLENAME VARCHAR2*/
P_PARAMS_REC PARAMS_REC; --THIS ISN'T WORKING
); --DROPS PRE-EXISTING TABLES
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OH i think i see what you mean. So i remove it from the body altogether, and just declare it in the spec only?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
...and if I chose to not declare the procedure at all in the spec, then I could leave the record defined in the body and I should be ok?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great! I appreciate you helping me understand that
ASKER