InvalidOperationException

InvalidOperationException

Postby MartinJJ » Thu 08 Apr 2010 11:16

Hi

I'm just evaluating dbConnect for Oracle with '11g client' 10.2.0.1 server for port of project from sqlserver to oracle. A sale for sure if it all works :D

Is there an equivilant/alternative approach for this type of thing. I have other
CompiledQuery
.

But I'm stuck with a
InvalidOperationException "Could not format node 'Nop' for execution as SQL."

Code: Select all
private static Func
            version_query = Devart.Data.Linq.CompiledQuery.Compile(
                (Grads3.GA_ORCL ga) =>
                    (UInt32)(
                        from spec in ga.Specifications.DefaultIfEmpty()
                        select spec == null ? 0 : (Int32)spec.SPC_VERSION
                     ).Sum()
            );


[list]at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(am A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(x A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(k A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(x A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(x A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(al A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(al A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a(SqlNode A_0, CommandType& A_1)
at Devart.Data.Linq.Provider.DataProvider.a(e A_0, Type A_1, SqlNode A_2, IList`1 A_3)
at Devart.Data.Linq.Provider.DataProvider.a(Expression A_0)
at Devart.Data.Linq.Provider.DataProvider.i(Expression A_0)
at Devart.Data.Linq.CompiledQuery.a(b A_0)
at Devart.Data.Linq.CompiledQuery.a(DataContext A_0, Object[] A_1)
at Devart.Data.Linq.CompiledQuery.Invoke[a,b](a A_0)
at Grads.Specs_ORCL.list(GA_ORCL ga) in D:\Martin\devart\devartTest\devartTest\Specs_ORCL.cs:line 43
at devartTest.Program.Main(String[] args) in D:\Martin\devart\devartTest\devartTest\Program.cs:line 30
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Code: Select all
[/list]



So DefaultIfEmpty() was the issue here.
Last edited by MartinJJ on Thu 08 Apr 2010 13:37, edited 1 time in total.
MartinJJ
 
Posts: 14
Joined: Thu 08 Apr 2010 10:55

Postby MartinJJ » Thu 08 Apr 2010 13:16

Hi

Also I
"Cannot use \"\" type value in \"UInt32\" type argument"
get from

Code: Select all
inheritance_query = Devart.Data.Linq.CompiledQuery.Compile(
                (Grads3.GA_ORCL ga) =>
                    from grp in ga.Groups
                    join g in
                        (
                            from g in ga.Groups
                            group g.GRP_INH_DEPTH by new { g.GRP_GROUP, g.GRP_SPEC } into t
                            select new { t.Key.GRP_GROUP, t.Key.GRP_SPEC, MAX_DEPTH = t.Max() }
                            ) on new { grp.GRP_GROUP, grp.GRP_SPEC } equals
                         new { g.GRP_GROUP, g.GRP_SPEC }
                    where grp.GRP_INH_DEPTH == 0 || grp.GRP_INH_DEPTH == 1
                    group grp.GRP_INH_DEPTH * grp.GRP_ANCESTOR by
                        new { grp.GRP_GROUP, grp.GRP_SPEC, g.MAX_DEPTH }
                        into t
                        orderby t.Key.GRP_GROUP, t.Key.MAX_DEPTH
                        select new InheritanceTriplet((uint)t.Key.GRP_GROUP, (uint)t.Key.GRP_SPEC, (uint)t.Max())
            );


gives this. I welcome any thoughts at all. :D

    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.CheckConversionToParameterType(SqlExpression argumentValue, Type parameterType)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ac A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(ac A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ac A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.g(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.d(ak A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(ak A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(ad A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ad A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(bb A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(bb A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(am A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.DataProvider.a(e A_0, Type A_1, SqlNode A_2, IList`1 A_3)
    at Devart.Data.Linq.Provider.DataProvider.a(Expression A_0)
    at Devart.Data.Linq.Provider.DataProvider.i(Expression A_0)
    at Devart.Data.Linq.CompiledQuery.a(b A_0)
    at Devart.Data.Linq.CompiledQuery.a(DataContext A_0, Object[] A_1)
    at Devart.Data.Linq.CompiledQuery.Invoke[a,b](a A_0)
    at Grads.Groups_ORCL.list(GA_ORCL ga) in D:\GA-Project\GA\Grads\Handlers\Groups_ORCL.cs:line 62
    at Grads.RestHandler_ORCL.InvokeGet(String method) in D:\GA-Project\GA\Grads\RestHandler_ORCL.cs:line 130
    at Grads.GA.getAll(String what) in D:\GA-Project\GA\Grads\GA.svc.cs:line 32
    at SyncInvokegetAll(Object , Object[] , Object[] )
    at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
MartinJJ
 
Posts: 14
Joined: Thu 08 Apr 2010 10:55

Postby AndreyR » Fri 09 Apr 2010 17:05

Thank you for the report, I have reproduced the 'Nop' problem.
We are investigating the issue, I will let you about the results as soon as possible.
The errors "Cannot use \"\" type value in \"UInt32\" type argument" seem to be associated with some particular grouping problems.
Could you please send us (support * devart * com, subject "LINQ: Empty Type") either a small project reproducing the error or a part of your DDL script concerning the objects used in at least one of the queries that throw the exception?
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle