CatalogNameOverwriteHashtable and action procedures

Posts   
 
    
dcarapic
User
Posts: 60
Joined: 21-Dec-2007
# Posted on: 14-Jul-2008 11:32:52   

Hi,

LLBLGen 2.5 Final (April 23d, 2008 ) and Oracle 11g.

I have noticed that generated action procedure call code has the name of the db schema hardcoded. Does this mean that action procedures ignore the CatalogNameOverwriteHashtable hashtable and catalogue overwritting? Is there a way around this so that the action procedure calling also takes CatalogNameOverwriteHashtable into account?

Thanks

Regards, Dalibor

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 14-Jul-2008 14:24:14   

I have noticed that generated action procedure call code has the name of the db schema hardcoded

Do you mean the C# or VB.NET code, or the runtime SQL query? If you are using CatalogNameOverwrites, the generated SQL query at runtime should point to the new catalog name.

dcarapic
User
Posts: 60
Joined: 21-Dec-2007
# Posted on: 14-Jul-2008 16:27:26   

Hi, Sorry for not being more precize. Here is an example of the action procedure code generated by the desinger:


        /// <summary>
        /// Calls stored procedure 'SKLAD_ARTIKLI.APPROVE_STOCK_TRANSFER'. Can't have any cursors.<br/><br/>
        /// 
        /// </summary>
        /// <param name="pArtStockTransferId">Input parameter of stored procedure</param>
        /// <param name="pUserId">Input parameter of stored procedure</param>
        /// <param name="adapter">The DataAccessAdapter object to use for the call</param>
        /// <returns>Amount of rows affected, if the database / routine doesn't surpress rowcounting.</returns>
        public static int SkladArtikliApproveStockTransfer(System.Decimal pArtStockTransferId, System.Decimal pUserId, DataAccessAdapter adapter)
        {
            OracleParameter[] parameters = new OracleParameter[2];
            parameters[0] = new OracleParameter("P_ART_STOCK_TRANSFER_ID", OracleType.Number, 0, ParameterDirection.Input, true, 22, 0, "",  DataRowVersion.Current, ConvertNullToDBNull(pArtStockTransferId));
            parameters[1] = new OracleParameter("P_USER_ID", OracleType.Number, 0, ParameterDirection.Input, true, 22, 0, "",  DataRowVersion.Current, ConvertNullToDBNull(pUserId));
            int toReturn = adapter.CallActionStoredProcedure("DEV.SKLAD_ARTIKLI.APPROVE_STOCK_TRANSFER", parameters);

            return toReturn;
        }
    

As you can see the catalog name 'DEV' is located inside the generated code. Since I do not see any output from calling action procedures in the trace I can not say if the catalog overrides works for them or not. I just assumed that they do not since the catalog name looks like a part of the procedure name.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Jul-2008 17:39:06   

StoredProcedures indeed takes into account CatalogNameOverwrites. If you follow the method adapter._CallActionStoredProcedure _you will see that there is another method called _CreateCorrectStoredProcedureName _which creates the correct name of the stored procedure.

So it should work, please do some test (you could debug your Code to get into that methods and see what name is actually used). If you still have troubles with the overriding please post the LLBLGenPro version and RuntimeLibraries version.

Hope helful wink

David Elizondo | LLBLGen Support Team
dcarapic
User
Posts: 60
Joined: 21-Dec-2007
# Posted on: 15-Jul-2008 14:17:06   

Hi,

Thank you for the reply. We will test it.

Regards, Dalibor