The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

SProc Problem, OCI-22060 Error

Last post 01-30-2008, 8:25 AM by Jobo. 2 replies.
Sort Posts: Previous Next
  •  01-30-2008, 6:47 AM 7831

    SProc Problem, OCI-22060 Error

    Hi everyone,

     i have generated the stored procedures and metadatamap for Oracle with MyGen 1.3 after converting every table from MsSQL to Oracle. Im now getting an "OCI-22060" Error: "OCI-22060: argument [2] is an invalid or uninitialized number". The only number in this specific table is the ID-Column, which is primary key and identity column.

    MetadataMap, relevant part:

     

    Code:
    	meta.AddTypeMap("ID", new esTypeMap("NUMBER", "System.Decimal"));
    meta.AddTypeMap("Name", new esTypeMap("NVARCHAR2", "System.String"));


     Stored procedure:

     

    Code:
    1    create or replace PROCEDURE         "ViewTypesInsert" 
    2 (
    3 pID IN "ViewTypes"."ID"%type,
    4 pName IN "ViewTypes"."Name"%type
    5 )
    6 IS
    7 BEGIN
    8
    9
    10 INSERT
    11 INTO
    "ViewTypes"
    12 (
    13 "ID",
    14 "Name"
    15 )
    16 VALUES
    17 (
    18 pID,
    19 pName
    20 );
    21 END ;

    Table Create: 

    Code:
    1    CREATE TABLE  "ViewTypes" 
    2 ( "ID" NUMBER(10,0) NOT NULL ENABLE,
    3 "Name" NVARCHAR2(100) NOT NULL ENABLE,
    4 CONSTRAINT "PK_VIEWTYPES" PRIMARY KEY ("ID") ENABLE
    5 )
    6 /
    7
    8 CREATE OR REPLACE TRIGGER "VIEWTYPES_ID_TRG" BEFORE INSERT OR UPDATE ON "ViewTypes"
    9 FOR EACH ROW
    10 BEGIN
    11 if
    inserting and :new.ID is NULL then
    12 SELECT
    ViewTypes_ID_SEQ.nextval into :new.ID FROM DUAL;
    13 end if;
    14 END;
    15
    16
    17 /
    18 ALTER TRIGGER "VIEWTYPES_ID_TRG" ENABLE
    19 /
    20


    C# Code:

     

    Code:
    1    ViewTypes vt = new ViewTypes();
    2    vt.AddNew();                            
    3    vt.Name = "CablePlan";
    4    vt.Save();
    

    This is the simplest table i have, the problem occurs on every other table, too. Im still not very familiar with Oracle, so every idea is appreciated.

    Edit: Changing the type to "System.Int32" does not change anything. 

    Thanks,

    Joris 

  •  01-30-2008, 8:01 AM 7833 in reply to 7831

    Re: SProc Problem, OCI-22060 Error

    The use of stored procedures is optional in EntitySpaces. But, before you generate SPs, or the MetadataMap, this article explains EntitySpaces handling of Oracle SEQ, and the MyGeneration User Metadata entries required.

    http://www.entityspaces.net/blog/2006/03/20/OracleSequencesAndConcurrencyHandling.aspx

    Post back, if you have additional questions.


    David Neal Parsons
    www.entityspaces.net
  •  01-30-2008, 8:25 AM 7834 in reply to 7833

    Re: SProc Problem, OCI-22060 Error

    thanks a lot! That seems to work.That link should be pinned somewhere in the OracleProviderForum :)

     Btw, using DynamicSql doesn't help without the UserMetadata, the ID is not being brought back, which makes sense now of course.


     

View as RSS news feed in XML