Home » U++ Library support » U++ SQL » [sql] Select embeded in join
Re: [sql] Select embeded in join [message #22821 is a reply to message #22815] |
Wed, 19 August 2009 16:32 |
Zbych
Messages: 326 Registered: July 2009
|
Senior Member |
|
|
One more thing. Right now, when I use AsValue of Select inside Insert:
sql & Insert(USERS)(USER_OID, Select(OID).From(PG_ROLES).Where(ROLNAME == User.GetData()).AsValue() )(USER_NAME, Name.GetData())(USER_SURNAME, Surname.GetData());
sql string looks like this:
insert into USERS(USER_OID, USER_NAME, USER_SURNAME) values (select oid from pg_roles where rolname = 'aaaaaaaa', 'aaaaa', 'aaaaaaa')
There should be another pair of parentheses around select, so AsValue should look like this:
SqlVal AsValue() const { return SqlVal(String("(") << text << ")", SqlVal::LOW); }
[Updated on: Wed, 19 August 2009 16:33] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 02:14:50 CEST 2024
Total time taken to generate the page: 0.03168 seconds
|