Home » SQL & PL/SQL » SQL & PL/SQL » How to pass decimal value to Oracle Stored Procedure (Oracle 10.2.0.3)
How to pass decimal value to Oracle Stored Procedure [message #318412] Tue, 06 May 2008 16:10 Go to next message
astreet
Messages: 1
Registered: May 2008
Junior Member
Is it possible to pass in a decimal value such as 12.222 to an oracle stored procedure?

The following code does not compile and you receive pl/sql error when you declare the passed in variable as NUMBER(5,3).

CREATE OR REPLACE PROCEDURE
test.TFB_ALTVOLST (v_repo_tran_num int, locID IN VARCHAR2, Frm_pressure_base IN NUMBER(5,3), To_pressure_base IN NUMBER(5,3), meas_yyyymm IN VARCHAR2, p_cursor OUT F_GMI.C_TYPES.GENERICCURSORTYPE)
AS

Error received
========================================================

DBMS COM02D -- PLS-00103: Encountered the symbol "(" when expecting one of the following:
16:04:14.065 DBMS COM02D -- := . ) , @ % default character
16:04:14.097 DBMS COM02D -- The symbol ":=" was substituted for "(" to continue.
16:04:14.128 DBMS COM02D -- PLS-00103: Encountered the symbol "(" when expecting one of the following:
16:04:14.144 DBMS COM02D -- := . ) , @ % default character
16:04:14.175 DBMS COM02D -- The symbol ":=" was substituted for "(" to continue.

============================================================
I can get around this error by declaring my numeric values as varchar2 and doing an converting them to a decimal using to_num function.

Any help is appreciated.
Re: How to pass decimal value to Oracle Stored Procedure [message #318416 is a reply to message #318412] Tue, 06 May 2008 16:20 Go to previous message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
CREATE OR REPLACE PROCEDURE
test.TFB_ALTVOLST (v_repo_tran_num int, locID IN VARCHAR2, Frm_pressure_base IN NUMBER, To_pressure_base IN NUMBER, meas_yyyymm IN VARCHAR2, p_cursor OUT F_GMI.C_TYPES.GENERICCURSORTYPE)


The INPUT variables inherit their 'size' from the calling routine.

[Updated on: Tue, 06 May 2008 16:21] by Moderator

Report message to a moderator

Previous Topic: failed to retrieve data from all_views from pl/sql
Next Topic: Unique Constraint size limit
Goto Forum:
  


Current Time: Sun Dec 11 04:14:23 CST 2016

Total time taken to generate the page: 0.10937 seconds