I get an error when trying to execute the following SQL
statements in NHibernate
. They work fine in TOAD
. The environment is Oracle
, C#
, .NET 4
and NHibernate
StringBuilder sb = new StringBuilder();
//some logic to select data from table1 in the where
//clause of the following statement
sb.Append(" insert into temp_table select * from table1 where ....; ");
sb.Append(" select t1.col1, t2.col2 from temp_table t1 join table2 t2 on t1.col1 = t2.col2 ");
IQuery query = Session.GetISession().CreateSQLQuery(sb.ToString()).SetResultTransformer(Transformers.AliasToBean(typeof(Class1)));
return query.List<Class1>();
Error that I get.
ORA-00911: invalid character
[GenericADOException: could not execute query....
If I copy the sql
generated by NHibernate
in toad
the same query works.