Skip to content

Join fails on Oracle9Dialect #3113

Closed
Closed
@khoshrou

Description

@khoshrou

Hi
I have just upgraded to 5.3.12 (it works in 5.2) and have a simple query running on an oracle database using Oracle9Dialect . Seems its creating wrong SQL.
Also for left outer joins I see old fashiond oracle SQL like:

A = B (+) 

which is not ANSI standard like:

Left Outer Join A on A.x = B.y

Here is my query:

var sampleQuery = (from globalUser in Session.Query<GlobalUser>()

                                           join userRole in Session.Query<UserRole>() on globalUser.ID
                                               equals
                                               userRole.GlobalUser.ID

                                           select new
                                           {
                                               UserName = globalUser.UserName,
                                               userRole.Role.Name
                                           }
                            );

var list = sampleQuery.Select(x=>x.UserName).ToList();

Exception I get:

NHibernate.Exceptions.GenericADOException: could not execute query
[ select globaluser0_.USERNAME as col_0_0_ from ACUSER globaluser0_ ACUSERROLE userrole1_ where (userrole1_.ACUSERID=globaluser0_.ID) ]

select globaluser0_.USERNAME as col_0_0_ from ACUSER globaluser0_ ACUSERROLE userrole1_ 
where (userrole1_.ACUSERID=globaluser0_.ID)

---> System.Data.OracleClient.OracleException: ORA-00933: SQL command not properly ended

clearly its a wrong sql generation.
Do you have any idea what's happening here?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions