Home » U++ Library support » U++ SQL » Problem with SqlUpdate
Re: Problem with SqlUpdate [message #45723 is a reply to message #45715] |
Tue, 29 December 2015 16:20   |
|
Hi nilrum,
Welcome to the forum 
nilrum wrote on Tue, 29 December 2015 07:51I tried the request, but is it wrong
SqlUpdate(LINK)(SqlSet(ID_OTHER), SqlSet(Select(ID_TWO).From(TWO).Where(NAME_TWO == "Name"))).Where(ID_LINK == 1);
==>
update LINK set (ID_OTHER) = (select ID_TWO from TWO where NAME_TWO = 'Name')
where ID_LINK = 1
How to remove the brackets around ID_OTHER?
The problematic brackets come from SqlSet(). You actually want just a single value, not a set of values:SqlUpdate(LINK)(ID_OTHER, SqlSet(Select(ID_TWO).From(TWO).Where(NAME_TWO == "Name"))).Where(ID_LINK == 1);
This should work as you intended.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Mon Apr 28 23:32:46 CEST 2025
Total time taken to generate the page: 0.04286 seconds
|