Update Objects Directly with data from db

Posts   
 
    
JRR avatar
JRR
User
Posts: 125
Joined: 07-Dec-2005
# Posted on: 14-Dec-2006 00:56:50   

Hi guys, simple_smile

I've read the docs on expressions, but I haven't understood how to accomplish this - update directly using data from another table:


Insert Into InventoryWarehouse(WarehouseCode)

(Select '105-' + SSN.prefix + '-' + CAST(SSN.number as varchar(10)) from

SystemStartingNumber SSN

where entity = 'InventoryBlock')


How would I turn the select statement into an expression? confused

VB.net 2.0 | LLBLGen 2.0 (Nov.6)

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 14-Dec-2006 06:42:27   

"Insert Into" is not supported. So in this case, you should fetch the SystemStartingNumber entity. Do the string concatenation programatically, and then Insert a new InventoryWarehouse entity with the concatenated string for the WarehouseCode.

JRR avatar
JRR
User
Posts: 125
Joined: 07-Dec-2005
# Posted on: 14-Dec-2006 06:57:02   

Hi Walaa

Thanks for the reply!

I was hoping to accomplish this in one database call.. cry

I'll resort to writing a SQL Function that I can call as an expression simple_smile