oibo8x / subsonicproject

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

WhereExpression problems using Qualifiedname column #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using the whereexpression there is a problem with how the sql is built.

For example
DB.SelectAllColumnsFrom<Products>()
.WhereExpression(Products.ProductIdColumn.QualifiedName).IsEqualTo(productId)

.And(Products.ProductName.QualifiedName).IsEqualTo("ABC")
.BuildSqlStatement()

The above produces:
SELECT.........
WHERE ([dbo].[Products].[[dbo].[Products].[ProductId]] = @ProductId0\r\n
AND [dbo].[Products].[ProductName] = @ProductName1\r\n)\r\n

As you can see from the above it actually puts [dbo].[Products] twice in
the WHERE clause since I'm using QualifiedName

Regards DotnetShadow

What steps will reproduce the problem?
1.
2.
3.

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

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by roberto...@gmail.com on 6 Aug 2008 at 5:58

GoogleCodeExporter commented 9 years ago
I get the same issue using the OracleDataProvider.   The error in the
OracleDataProvider occurs as the schema is referenced in the Where clause and 
not the
From clause.  Either it needs to be added the Table in the FROM clause or 
removed
from the columns in the WHERE clause.

Original comment by run...@gmail.com on 11 Aug 2008 at 3:00

GoogleCodeExporter commented 9 years ago
Fixed with revision 502 - thanks!

Original comment by robcon...@gmail.com on 9 Apr 2009 at 12:59