Procedures with same names
Posted: Tue 15 Oct 2019 06:20
I have an Oracle package with 2 procedures with same name, but different number of parameters:
Entity Data Model Designer creating model from Database puts ":1" and ":2" into StoreFunctionName:
When I try to call methods, created from these procedures, I can see, that Devart tries to call "TEST_OVERLOADED_P.OVERLOADED:1" procedure (with :1 in name) and an error is raised:
I'm using Devart Entity Developer version 6.5.823 and Devart.Data.Oracle version 9.8.838 with Oracle 12 Client
Code: Select all
create or replace package test_overloaded_p is
-- Purpose : Test Model generation for procedures with same name
-- %usage Procedure with 2 parameters
procedure overloaded(
iDate in date,
oResult out varchar2
);
-- %usage Procedure with 3 parameters
procedure overloaded(
iDate in date,
iText in varchar2,
oResult out varchar2
);
end test_overloaded_p;
/
create or replace package body test_overloaded_p is
-- %usage Procedure with 2 parameters
procedure overloaded(
iDate in date,
oResult out varchar2
)
is
begin
if iDate>trunc(sysdate) then
oResult:='T';
end if;
oResult:='F';
end;
-- %usage Procedure with 3 parameters
procedure overloaded(
iDate in date,
iText in varchar2,
oResult out varchar2
)
is
begin
if iDate>trunc(sysdate) and iText is not null then
oResult:='T';
end if;
oResult:='F';
end;
end test_overloaded_p;
/
Code: Select all
<Function Name="OVERLOADED:1" IsComposable="false" BuiltIn="false" Aggregate="false" NiladicFunction="false" ParameterTypeSemantics="AllowImplicitConversion" StoreFunctionName="TEST_OVERLOADED_P.OVERLOADED[b]:1[/b]">
<Parameter Name="IDATE" Type="DATE" Mode="In" />
<Parameter Name="ORESULT" Type="VARCHAR2" Mode="Out" />
</Function>
<Function Name="OVERLOADED:2" IsComposable="false" BuiltIn="false" Aggregate="false" NiladicFunction="false" ParameterTypeSemantics="AllowImplicitConversion" StoreFunctionName="TEST_OVERLOADED_P.OVERLOADED[b]:2[/b]">
<Parameter Name="IDATE" Type="DATE" Mode="In" />
<Parameter Name="ITEXT" Type="VARCHAR2" Mode="In" />
<Parameter Name="ORESULT" Type="VARCHAR2" Mode="Out" />
</Function>
Code: Select all
"System.Data.EntityCommandExecutionException
HResult=0x8013193C
Message=An error occurred while executing the command definition. See the inner exception for details.
Source=System.Data.Entity
Inner Exception 1:
OracleException: ORA-06550: line 2, column 31:
PLS-00103: Encountered the symbol "" when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "" to continue.