Hi all.
Here's my problem:
Consider a package MY_PKG with the following two functions
FUNCTION get_number_by_r owid(
p_table_name IN VARCHAR2,
p_column_name IN VARCHAR2,
p_rowid IN UROWID,
p_result OUT NUMBER
) RETURN PLS_INTEGER;
FUNCTION get_number_by_r owid(
p_table_name IN VARCHAR2,
p_column_name IN VARCHAR2,
p_rowid IN UROWID,
p_error_code IN PLS_INTEGER := -20001
) RETURN NUMBER;
Now here's a code block with an invocation of the function:
DECLARE
v_rc pls_integer;
v_table_name varchar2(30);
v_rowid UROWID;
v_result number;
BEGIN
v_table_name := '...';
v_rowid := '....';
v_rc := MY_PKG.get_numb er_by_rowid(
v_table_name, 'surrogat', v_rowid, v_result
);
....
END;
On our 10g-Server this compiles well, but a customer reports, that on compilation of the block above (not the package, which compiles well) he receives 'PLS-00307: Too many declarations of "get_number_by_ rowid" match this call'. And I have to admit: THAT'S CORRECT! Which of the two prototypes is to be executed? In both cases, we have 4 Arguments with types VARCHAR2, VARCHAR2, UROWID for the first three in both signatures, while the forth one is OUT NUMBER resp. IN PLS_INTEGER. Since the 4th argument of the invocation is a variable (a L-Value for people knowing C/C++), it might be an IN as well as an OUT-argument (since each L-Value is a R-Value also), so that's no help either. I don't know excatly, whether PLS_INTEGER is a subtype of NUMBER, but by mere intuition they belong to the same data type "family" of numeric datatypes, so I have to agree with our customer's compiler (don't know the exact client and server versions yet), that the invocation is indeed ambiguos.
So - why does our 10g server, along with a 9i client, compile the invocation code without problems? How can it determine the correct function variant to use? Would using named notation for the 4th argument help to resolve to conflict (v_rc := MY_PKG.get_numb er_by_rowid(v_t able_name, surrogat', v_rowid, p_result => v_result)?
Here's my problem:
Consider a package MY_PKG with the following two functions
FUNCTION get_number_by_r owid(
p_table_name IN VARCHAR2,
p_column_name IN VARCHAR2,
p_rowid IN UROWID,
p_result OUT NUMBER
) RETURN PLS_INTEGER;
FUNCTION get_number_by_r owid(
p_table_name IN VARCHAR2,
p_column_name IN VARCHAR2,
p_rowid IN UROWID,
p_error_code IN PLS_INTEGER := -20001
) RETURN NUMBER;
Now here's a code block with an invocation of the function:
DECLARE
v_rc pls_integer;
v_table_name varchar2(30);
v_rowid UROWID;
v_result number;
BEGIN
v_table_name := '...';
v_rowid := '....';
v_rc := MY_PKG.get_numb er_by_rowid(
v_table_name, 'surrogat', v_rowid, v_result
);
....
END;
On our 10g-Server this compiles well, but a customer reports, that on compilation of the block above (not the package, which compiles well) he receives 'PLS-00307: Too many declarations of "get_number_by_ rowid" match this call'. And I have to admit: THAT'S CORRECT! Which of the two prototypes is to be executed? In both cases, we have 4 Arguments with types VARCHAR2, VARCHAR2, UROWID for the first three in both signatures, while the forth one is OUT NUMBER resp. IN PLS_INTEGER. Since the 4th argument of the invocation is a variable (a L-Value for people knowing C/C++), it might be an IN as well as an OUT-argument (since each L-Value is a R-Value also), so that's no help either. I don't know excatly, whether PLS_INTEGER is a subtype of NUMBER, but by mere intuition they belong to the same data type "family" of numeric datatypes, so I have to agree with our customer's compiler (don't know the exact client and server versions yet), that the invocation is indeed ambiguos.
So - why does our 10g server, along with a 9i client, compile the invocation code without problems? How can it determine the correct function variant to use? Would using named notation for the 4th argument help to resolve to conflict (v_rc := MY_PKG.get_numb er_by_rowid(v_t able_name, surrogat', v_rowid, p_result => v_result)?
Comment