PL/SQL Procedure Char Parameter
10,032
Is there anyway of specifying a size for parameters in PL/SQL procedures?
No, as documented in the manual
Quote from http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/subprograms.htm#sthref1640
For each parameter, you specify:
- Its name.
- Its parameter mode (...)
- Its datatype. You specify only the type, not any length or precision constraints
(Emphasis mine)
Author by
philb28
Updated on June 14, 2022Comments
-
philb28 almost 2 years
This is quite possibly a very stupid question but I've tried searching for and answer and come up empty.
I'm writing a procedure that takes a single parameter of type CHAR. i.e:
CREATE PROCEDURE Proc1 (Param1 CHAR(5)) AS BEGIN ... END;
This doesn't work and throws an error around the CHAR(5) area. If I don't specify a size for the parameter, so just leave it as CHAR it works fine. I've tried including the keyword IN but this makes no difference.
Is there anyway of specifying a size for parameters in PL/SQL procedures?
-
philb28 about 12 yearsThank you. I had looked at this page but must have skipped right over that. Thanks for clearing this up.