Procedures with same names

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
vdobzinski
Posts: 7
Joined: Fri 05 Mar 2010 11:18
Location: Vilnius

Procedures with same names

Post by vdobzinski » Tue 15 Oct 2019 06:20

I have an Oracle package with 2 procedures with same name, but different number of parameters:

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;
/
Entity Data Model Designer creating model from Database puts ":1" and ":2" into StoreFunctionName:

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>
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:

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.
I'm using Devart Entity Developer version 6.5.823 and Devart.Data.Oracle version 9.8.838 with Oracle 12 Client

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Procedures with same names

Post by Shalex » Sat 19 Oct 2019 15:21

Thank you for your report. We have reproduced the issue and are investigating it. We will notify you about the result.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Procedures with same names

Post by Shalex » Sat 26 Oct 2019 15:58

We have fixed the bug with calling overloaded stored procedures and functions in EF6.

As a temporary workaround, please change names of your store functions in the model:
"TEST_OVERLOADED_P.OVERLOADED:1" -> "TEST_OVERLOADED_P.OVERLOADED:01"
"TEST_OVERLOADED_P.OVERLOADED:2" -> "TEST_OVERLOADED_P.OVERLOADED:02"

Starting from the next public build, adding zero to the number of overload will be not required.

vdobzinski
Posts: 7
Joined: Fri 05 Mar 2010 11:18
Location: Vilnius

Re: Procedures with same names

Post by vdobzinski » Mon 28 Oct 2019 07:13

And how about earlier Entity Frameworks - EF4, EF5?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Procedures with same names

Post by Shalex » Mon 28 Oct 2019 14:49

vdobzinski wrote: Mon 28 Oct 2019 07:13 And how about earlier Entity Frameworks - EF4, EF5?
Actually, the fix is implemented on the ADO.NET level, so it covers all EF versions.

vdobzinski
Posts: 7
Joined: Fri 05 Mar 2010 11:18
Location: Vilnius

Re: Procedures with same names

Post by vdobzinski » Mon 28 Oct 2019 15:31

Is this fix included into dotConnect 9.9.867 24-Oct-19 version?
Can I check "Update model from database" functionality?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Procedures with same names

Post by Shalex » Wed 30 Oct 2019 19:54

The fix will be included in the next public build. We are planning to release it this week.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Procedures with same names

Post by Shalex » Fri 01 Nov 2019 19:17

The bug with calling overloaded stored procedures and functions is fixed in v9.9.872: viewtopic.php?f=1&t=39508.

Post Reply