1 Reply Latest reply: Oct 12, 2012 6:08 AM by Tridus RSS

    ORA-06550: PLS-00306 error with EF

    932936
      Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
      PL/SQL Release 11.2.0.2.0 - Production
      CORE     11.2.0.2.0     Production
      TNS for Linux: Version 11.2.0.2.0 - Production
      NLSRTL Version 11.2.0.2.0 - Production

      All,

      I have a procedure:



      type rc is ref cursor

      procedure sp_Ins_Something
      (
      pRC out rc,
      pSomeValue1 in number,
      pSomeValue2 in number
      );

      procedure sp_Ins_Something
      (
      pRC out rc,
      pSomeValue1 in number,
      pSomeValue2 in number
      ) as
      begin
      INSERT
      INTO MyTable
      (
      MyPKID,
      SomeValue1,
      SomeValue2
      )
      VALUES
      (
      MyTablePKID_Seq.NEXTVAL,
      pSomeValue1,
      pSomeValue2
      );
      OPEN pRC FOR SELECT MyTablePKID_Seq.CURRVAL FROM DUAL;

      When I execute on the server, everything is fine.

      However, when attempting to update via EF (model-first), I get the ubiquitous error as noted in the subject. I have SomeValue1 and SomeValue2 mapped as input parameters to values in my entity, and I have CURRVAL as an output parameter mapping to MyPKID in my entity. So, as far as I can tell, I followed the instructions correctly, but clearly I missed a step somewhere. Any ideas how I can go about fixing this?

      Below is the relavent edmx stuff if it helps:

      <EntityType Name="MyTable">
      <Key>
      <PropertyRef Name="MyTablePKID" />
      </Key>
      <Property Name="MyTablePKID" Type="number" Nullable="false" Precision="10" StoreGeneratedPattern="Identity" />
      <Property Name="SomeValue1" Type="number" Precision="10" />
      <Property Name="SomeValue2" Type="number" Precision="10" />
      </EntityType>
      ...

      <EntityTypeMapping TypeName="MyNamespace.MyTable">
      <ModificationFunctionMapping>
      <InsertFunction FunctionName="MyNamespace.Store.MyPackage_sp_Ins_Something" >
      <ScalarProperty Name="SomeValue1" ParameterName="pSomeValue1" />
      <ScalarProperty Name="SomeValue2" ParameterName="pSomeValue2" />
      <ResultBinding Name="MyTablePKID" ColumnName="CURRVAL" />
      </InsertFunction>
           ...
      </EntityTypeMapping>
      ...

      Thanks in advance.

      EDIT: I should point out that I've already verified that this stored procedure is mapped to the correct entity, and that it's only being mapped to that entity's Insert command.

      Edited by: 929933 on Oct 11, 2012 2:12 PM