EF Core beta2: FindAsync ERROR ORA-00933 — oracle-tech

    Forum Stats

  • 3,715,998 Users
  • 2,242,925 Discussions
  • 7,845,726 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

EF Core beta2: FindAsync ERROR ORA-00933

Molonator69
Molonator69 Member Posts: 7
edited March 2019 in ODP.NET

HI.

I´m test the EF Core Beta2 and I have this problem very strange

I have this table:

CREATE TABLE SCHEMA.Test(

  SISTEMA    VARCHAR2(1)   NOT NULL,

  NIVEL0     NUMBER(9)     NOT NULL,

  NIVEL1     NUMBER(5)     NOT NULL,

  DESCRIPTION       VARCHAR2(50)  ,

  PRIMARY KEY ("SISTEMA")                   

);

Mapped as:

[Table("TEST", Schema = "SCHEMA")]

public class Test{

    [Required, Key, Column("SISTEMA", Order = 1, TypeName = "VARCHAR2(1)")]

    public String Sistema { get; set; }

    [Required, Column("NIVEL0", Order = 2, TypeName = "NUMBER(9)")]

    public int? Nivel0 { get; set; }

    [Required, Column("NIVEL1", Order = 3, TypeName = "NUMBER(9)")]

    public int? Nivel1 { get; set; }

    [Required, Column("DESCRIPTION", TypeName = "VARCHAR2(50)")]

    public String Descripcion { get; set; }

}

Add record do OK,

But when I find a record:

try
{
    Test elem = await _context.TTest.FindAsync("A");

    _context.TTest.Remove(elem);
    await _context.SaveChangesAsync();

    return await _context.TTest.ToListAsync();
}
catch (Exception ex)
{
    throw ex;
}

Throws The exception:

   ORA-00933:  SQL command not properly ended

Any Idea?

thx

Message = "ORA-00933: comando SQL no terminado correctamente"

Best Answer

  • Molonator69
    Molonator69 Member Posts: 7
    edited March 2019 Accepted Answer

    HI!.

    I find the solution.

    When I declare the connection, the parameter must be included

    optionsBuilder.UseOracle("... Connect string ...",

                    b => b.UseOracleSQLCompatibility("11"));

Answers

  • Molonator69
    Molonator69 Member Posts: 7
    edited March 2019 Accepted Answer

    HI!.

    I find the solution.

    When I declare the connection, the parameter must be included

    optionsBuilder.UseOracle("... Connect string ...",

                    b => b.UseOracleSQLCompatibility("11"));

Sign In or Register to comment.