Search found 5 matches

by piers7
Fri 01 Jul 2011 05:57
Forum: dotConnect for Oracle
Topic: Insert sequence.NEXT_VAL in Entity Framework.
Replies: 10
Views: 42404

Be sure to set StoreGeneratedPattern *in the XML*

Shalex wrote:Please make sure that the StoreGeneratedPattern attribute is set to "Identity" for the corresponding column in the storage part of your model (SSDL): http://msdn.microsoft.com/en-us/library/bb738536.aspx.
That tripped me up, because setting it in the conceptual model (in Microsoft's designer at least) doesn't set the property in the SSDL model. You have to go and edit the XML by hand...
by piers7
Fri 01 Jul 2011 05:00
Forum: Entity Framework support
Topic: 'ORA-00928: missing SELECT keyword' saving identity-only tbl
Replies: 2
Views: 2566

'ORA-00928: missing SELECT keyword' saving identity-only tbl

It's an edge-case, but I'm posting for reference in case anyone else runs into this.

I have a table with one, sequence-generated column, setup as an identity property in the model. So when I insert into that table via the model there are no attributes to set on the entity.

Either EF or the dotConnect driver creates the wrong Oracle insert statement when I call SaveChanges() on the context. The SQL generated is something like this:

Code: Select all

insert into MY_TABLE () values ()
...wheras Oracle requires something like this:

Code: Select all

insert into MY_TABLE values(default)
Took me running through a profiler to figure this one out. In this case the table will (ultimately) have some extra columns, which will fix the issue, but one to be aware of.
by piers7
Thu 30 Jun 2011 08:39
Forum: Entity Framework support
Topic: Column Compatibility Mapping Oracle
Replies: 11
Views: 11242

ORA-03115 reading BINARY_FLOAT with Direct=true

This SSDL \ CSDL hack only appears to work using non-direct mode. It works for writes, but any time I try and read the data back I get:

ORA-03115: unsupported network datatype or representation

This happens using the following SSDL \ CSDL combos:
BINARY_FLOAT \ Decimal (what 'update from database' creates)
decimal \ Decimal
double \ Double
single \ Single

If I remove the BINARY_FLOAT column from the model completely (delete from SSDL and CSDL) it works just fine.

If I change the driver to non-direct mode (Direct=false and specify a Home) it works fine
by piers7
Thu 30 Jun 2011 08:07
Forum: Entity Framework support
Topic: Column Compatibility Mapping Oracle
Replies: 11
Views: 11242

Hacking SSDL BINARY_FLOAT to float

Thanks for that. It does indeed work if I hack the SSDL, but that's a bug surely. Either the initial model generation got it wrong (and should have kicked out a float [ie 'single']), or (probably preferable) there should be a type mapping from BINARY_FLOAT to float (and not to decimal).
by piers7
Wed 29 Jun 2011 07:19
Forum: Entity Framework support
Topic: Column Compatibility Mapping Oracle
Replies: 11
Views: 11242

BINARY_FLOAT / BINARY_DOUBLE mapped wrong

Shalex wrote:Oracle to .NET types mapping table (Entity Data Model Wizard):

[Oracle:FLOAT, REAL, BINARY_FLOAT, BINARY_DOUBLE ] -> [SSDL:the same] -> [CSDL:Decimal] -> [.NET:System.Decimal]
Why on earth would you map BINARY_FLOAT / BINARY_DOUBLE to decimal, and not to float/double respectively? That's the whole point of using the 4/8 byte IEEE standard types, surely. Even *Oracle* gets this mapping right.