Home » U++ Library support » U++ SQL » How to use Sql * Update
How to use Sql * Update [message #19632] |
Wed, 24 December 2008 14:47  |
 |
michael
Messages: 153 Registered: May 2007 Location: Germany
|
Experienced Member |
|
|
I'm trying to use the following code to update a sql-table:
Sql sql(session);
sql * Update(SqlId(sqlTable))
(NAME, customer.name)
(NUMMER, customer.number)
(PRODUKT, customer.product)
(VERSION, customer.version)
(STANDORT, customer.location)
(ANBINDUNG, customer.connection)
(BEMERKUNG, customer.comment)
.Where(ID == customer.sqlID);
I get these error:
H:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1274) : error C2660: 'Upp::Ctrl::Update' : function does not take 1 arguments
H:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1282) : error C2228: left of '.Where' must have class/struct/union
prohibisZA: 1 file(s) built in (0:01.87), 1872 msecs / file, duration = 1919 msecs, parallelization 0%
There were errors. (0:02.48)
What went wrong?
|
|
|
Re: How to use Sql * Update [message #19634 is a reply to message #19632] |
Wed, 24 December 2008 17:45   |
 |
michael
Messages: 153 Registered: May 2007 Location: Germany
|
Experienced Member |
|
|
Found out that this works:
Sql sql(session);
sql * SqlUpdate(SqlId(sqlTable))
(NAME, customer.name)
(NUMMER, customer.number)
(PRODUKT, customer.product)
(VERSION, customer.version)
(STANDORT, customer.location)
(ANBINDUNG, customer.connection)
(BEMERKUNG, customer.comment)
.Where(ID == customer.sqlID);
So is it ok to use SqlSelect, SqlInsert and SqlUpdate instead of Select, Insert and Update(which does not work)?
|
|
|
|
|
Re: How to use Sql * Update [message #19792 is a reply to message #19637] |
Wed, 21 January 2009 14:07  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
michael wrote on Fri, 26 December 2008 05:32 | But SqlSelect isn't equivalent to Select?
When i do this:
sql * Select(SqlId(sqlWhat)).From(SqlId(sqlTable)).Where(sqlWhere).OrderBy(sqlOrder);
Everthing is ok, but when i do this:
sql * SqlSelect(SqlId(sqlWhat)).From(SqlId(sqlTable)).Where(sqlWhere).OrderBy(sqlOrder)
I get the following error:
H:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1069) : error C2440: '<function-style-cast>' : cannot convert from 'Upp::SqlId' to 'Upp::SqlS
elect'
No constructor could take the source type, or constructor overload resolution was ambiguous
H:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1069) : error C2228: left of '.From' must have class/struct/union
H:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1069) : error C2228: left of '.Where' must have class/struct/union
H:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1069) : error C2228: left of '.OrderBy' must have class/struct/union
prohibisZA: 1 file(s) built in (0:01.96), 1966 msecs / file, duration = 1997 msecs, parallelization 0%
There were errors. (0:02.63)
|
Yes, but it was not intentional, rather forgotten. Now fixed.
[Updated on: Wed, 21 January 2009 14:08] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:23:32 CEST 2025
Total time taken to generate the page: 0.00878 seconds
|