Select Into

Posts   
 
    
ericl
User
Posts: 2
Joined: 01-Dec-2008
# Posted on: 01-Dec-2008 16:31:53   

I am in the process of evaluating the product at the moment and I am impressed.

I am trying to rewrite one of our existing applications using LLBLGen. This uses quite a lot of Stored procedures on a sql2000 server for Crud Operations which I would like to do in LLBLGen.

Only problem I am having is getting my head around batch updates where we are checking to see if Items exist in a database if not we add them using a select into. In effect we have 3 stored procedures for this type of operation,Insert, Archive and Remove.

Example of a simple proc is shown below:

INSERT INTO ArchiveMoAdhoc SELECT dbo.framemoadhoc.Morder, dbo.framemoadhoc.priority,dbo.framemoadhoc.PriorityAllocated FROM dbo.framemoadhoc LEFT OUTER JOIN dbo.SQ_MAKING_ORDERS ON dbo.framemoadhoc.Morder = dbo.SQ_MAKING_ORDERS.MORDER WHERE (dbo.SQ_MAKING_ORDERS.MORDER IS NULL)

I am using LLBLgen 2.6 Final demo.

Project configuration is SelfService,2 classes.

Development environment is vs2005 using Visual Basic.

Many thanks for your kind assistance.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 01-Dec-2008 16:54:03   

INSERT INTO is not currently available, so you'll have to first fetch the entityCollection then project it into the other entityCollection to be saved (Inserted).

ericl
User
Posts: 2
Joined: 01-Dec-2008
# Posted on: 02-Dec-2008 10:06:03   

Walaa wrote:

INSERT INTO is not currently available, so you'll have to first fetch the entityCollection then project it into the other entityCollection to be saved (Inserted).

Thanks for the prompt reply,Walaa.

I think I'll stick with the sp batch files for the moment as I want to make the rewrite as simple as possible.

Cheers