How to use ExecuteActionQuery with SQL 2000

Posts   
 
    
Ren
User
Posts: 42
Joined: 01-Jul-2005
# Posted on: 01-Jul-2005 21:03:30   

I have been spinning my wheels trying to figure out how to get LLBL to use the Adapter.ExecuteActionQuery method.

I have a query that I feel is a pretty complicated one and I would like to just send it rather than build it via code.


UPDATE Billable_Item Set Clnt_Cntrct_Ver_Id = (SELECT cv.Clnt_Cntrct_Ver_Id FROM Client_Contract_Version cv WHERE cv.Clnt_Cntrct_Id = c.Clnt_Cntrct_Id AND cv.Clnt_Cntrct_Ver_Dt = (SELECT Max(cv2.Clnt_Cntrct_Ver_Dt) FROM Client_Contract_Version cv2 WHERE cv2.Clnt_Cntrct_Id = c.Clnt_Cntrct_Id)) FROM Billable_Item bi INNER JOIN Client_Contract c On bi.Org_Id = c.Org_Id And bi.Bill_Item_Event_Dt_Tm Between c.Clnt_Cntrct_Start_Dt And c.Clnt_Cntrct_End_Dt WHERE bi.Clnt_Cntrct_Ver_Id Is Null


Does anyone have an example of how I could pass this to the database to run the update?

Thanks, Ren

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 01-Jul-2005 21:16:43   

You use a query for the value you want to set a field to. That's currently not supported.

Also, ExecuteActionQuery is not what you need. You should use UpdateEntitiesDirectly for direct update queries on the DB.

Frans Bouma | Lead developer LLBLGen Pro