Stored Procedure call As Query exception

Posts   
 
    
jovball
User
Posts: 443
Joined: 23-Jan-2005
# Posted on: 05-Oct-2011 22:02:13   

I am calling a DB2 stored procedure via LLBLGen. It works correctly if I call it via RetrievalProcedures.<ProcedureNameHere>.

However, if I use RetrievalProcedures.Get<ProcedureNameHere>CallAsQuery, I get an exception. The exception seems to show that LLBLGen is truncating the schema name by one letter on each end. That is, if the schema name is MySchema, the generated code is attempting to execute "ySchem.<ProcedureNameHere>".

In the DbSpecfic project, the call looks like this:

Return New StoredProcedureCall(dataAccessProvider, """MySchema"".""ProcedureNameHere""", "LLBlGenSpNameHere")

I don't understand why calling it one way works and the other way does not.

I should also mention that I am using a custom DB2 driver for DataDirect ADO.NET.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Oct-2011 05:36:56   

Hi Joel,

Please provide - the exact exception message and stack trace. - the code you are using which triggers the exception - How do you know that a letter is truncated? Do you see the generated sql? If so, pleas post it here.

David Elizondo | LLBLGen Support Team
jovball
User
Posts: 443
Joined: 23-Jan-2005
# Posted on: 06-Oct-2011 15:21:41   

Daelmo:

Here is the function generated by the LLBLGen template:


        ''' <summary>Creates the Call Object For the Call 'CsenetPendingInitiatingCaseList' to stored procedure 'SP_CASE_INIT_066'.</summary>
        ''' <param name="dataAccessProvider">The data access provider.</param>
        ''' <param name="workerId">Input parameter</param>
        ''' <returns>Ready To use StoredProcedureCall Object</returns>
        Private Shared Function CreateCsenetPendingInitiatingCaseListCall(dataAccessProvider As IDataAccessCore, workerId As System.String) As StoredProcedureCall

            Return New StoredProcedureCall(dataAccessProvider, """WELDIVDX"".""SP_CASE_INIT_066""", "CsenetPendingInitiatingCaseList") _
                .AddParameter("P_WORKER_ID", "Char", 8, ParameterDirection.Input, True, 0, 0, workerId)
        End Function

This code works:

Dim table As DataTable = RetrievalProcedures.CsenetPendingInitiatingCaseList(workerId)

This code doesn't and produces the exception shown below:


Using query As IRetrievalQuery = RetrievalProcedures.GetCsenetPendingInitiatingCaseListCallAsQuery(workerId)

Note that the schema name shown in the exception below has one letter missing at each end.

Stack Trace:

[DB2Exception (0x80004005): SQL0440N: No PROCEDURE by the name ELDIVD.SP_CASE_INIT_066 having compatible arguments was found.] DDTek.DB2.DRDA.ae.bb() +178 DDTek.DB2.DRDA.bm.a4(Int16 , Int16 ) +473 DDTek.DB2.DRDA.ae.a4(Int16 , Int16 ) +1149 DDTek.DB2.DRDA.bd.a4(Int16 , Int16 ) +749 DDTek.DB2.DRDA.bm.bd() +148 DDTek.DB2.DRDA.ae.bd() +12 DDTek.DB2.DB2Command.a(CommandBehavior , Boolean ) +3178 DDTek.DB2.DB2Command.ExecuteReader(CommandBehavior behavior) +296 DDTek.DB2.DB2Command.ExecuteDbDataReader(CommandBehavior behavior) +4 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10 SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Query\RetrievalQuery.cs:94

[ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: SQL0440N: No PROCEDURE by the name ELDIVD.SP_CASE_INIT_066 having compatible arguments was found.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.] SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Query\RetrievalQuery.cs:132 SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchDataReader(IRetrievalQuery queryToExecute, CommandBehavior readerBehavior) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\AdapterSpecific\DataAccessAdapterBase.cs:1576 DCSE.iAPECS.BusinessLogic.PendingInitiatingCaseListingDataAccess.GetDataList(String workerId) in C:\VS-Projects\DCSE.iAPECS-StarterSolution\DCSE.iAPECS.BusinessLogic\DTO\PendingInitiatingCaseListingDataAccess.vb:13 DCSE.iAPECS.Web.UI.AuthorizationTest.BindGridToStoredProcedure() in C:\VS-Projects\DCSE.iAPECS-StarterSolution\DCSE.iAPECS.Web.UI\Account\AuthorizationTest.aspx.vb:49 DCSE.iAPECS.Web.UI.AuthorizationTest.Page_Load(Object sender, EventArgs e) in C:\VS-Projects\DCSE.iAPECS-StarterSolution\DCSE.iAPECS.Web.UI\Account\AuthorizationTest.aspx.vb:12 System.Web.UI.Control.OnLoad(EventArgs e) +91 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Oct-2011 22:00:30   

Mmm. disappointed Could you please attach your llblgen project? (you could only include the involved procedure in the project, also an script for the DB, all zipped. Is there any thing one should know to reproduce this?

You can open a HelpDesk thread to attach your files so only you and the Support Team can see them.

David Elizondo | LLBLGen Support Team
jovball
User
Posts: 443
Joined: 23-Jan-2005
# Posted on: 07-Oct-2011 13:25:52   

I posted a request with the Help Desk