Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot specify year precision in INTERVAL stored procedure parameter

681619Mar 4 2009 — edited Mar 4 2009
Oracle version 10.2.0.3.0

I am writing a PL/SQL stored procedure that accepts a parameter of type INTERVAL YEAR TO MONTH. For example...
CREATE OR REPLACE PROCEDURE INTERVAL_TEST ( pin_Interval IN INTERVAL YEAR TO MONTH )
Problem with the above is that if I try to call it with pin_Interval = '100-00', I get the following error...
ORA-01873: the leading precision of the interval is too small
... but I am not able to specify the precision of the YEAR component in the stored procedure defintion as follows...
CREATE OR REPLACE PROCEDURE INTERVAL_TEST ( pin_Interval IN INTERVAL YEAR(4) TO MONTH )
... this results in...
PLS-00103: Encountered the symbol "(" when expecting one of the following:     to 
Try as I might, I can't create a stored procedure that will take in an INTERVAL YEAR TO MONTH with greater than 2 precision on the year.

Hopefully I am just doing something stupid, and this is not a limitation of PL/SQL.

Any help is appreciated.
This post has been answered by Walter Fernández on Mar 4 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2009
Added on Mar 4 2009
2 comments
405 views