jonpryor / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
0 stars 0 forks source link

"BindByName" should be set to true for Oracle ODP.NET command objects #252

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Using the Oracle ODP.NET provider execute this code (e.g. by pasting it in
Program3Ora.cs in DbLinq.Oracle_test_odp):

using (var context = new ReadTest().CreateDB()) {
  var c = context.Categories.First();
  c.CategoryName += "!";
  context.SubmitChanges();
}

What is the expected output? What do you see instead?

An update of a category is expected, but when run it attempts to execute
two queries, but fails during the second with the error "ORA-01722: invalid
number" (probably because "Beverages!" isn't a number):

SELECT LimitedTable___.*, rownum Limit___ FROM (
SELECT "CategoryID", "CategoryName", "Description", "Picture"
FROM "NORTHWIND"."Categories"
) LimitedTable___ WHERE rownum <= 1

UPDATE "NORTHWIND"."Categories" SET "CategoryName" = :CategoryName
WHERE "CategoryID" = :CategoryID
-- :CategoryID: Input Decimal (Size = 0; Prec = 0; Scale = 0) [1]
-- :CategoryName: Input String (Size = 0; Prec = 0; Scale = 0)
[Beverages!]

Adding the attached patch seem to solve the problem. The fix is Oracle ODP
specific, but it is placed in core code and what about other places where
command objects is constructed.

Problem reported here:
http://groups.google.com/group/dblinq/browse_thread/thread/1f461466160af3b9

Please use labels and text to provide additional information.

Original issue reported on code.google.com by anders...@gmail.com on 9 May 2010 at 12:00

Attachments: