mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-07 22:03:42 -06:00
+Sql: new method SqlUpdate::Column(const SqlSet& cols, const SqlSet& vals) supports Oracle-style multicolumn SET in UPDATE (UPDATE xxx set (A, B, C) = select A, B, C from yyy)
+TSql: new variants Force[Schema]Update support incremental updates according to comparison of 'old' and 'new' row data git-svn-id: svn://ultimatepp.org/upp/trunk@2570 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
83d052093d
commit
6388462fa4
6 changed files with 60 additions and 1 deletions
|
|
@ -236,7 +236,7 @@ struct sReadFields : public FieldOperator {
|
|||
Sql *sql;
|
||||
|
||||
void Field(const char *name, Ref f) {
|
||||
f = (*sql)[SqlId(name)];
|
||||
sql->GetColumn(SqlId(name), f);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -262,6 +262,17 @@ void Sql::GetColumn(int i, Ref r) const {
|
|||
cn->GetColumn(i, r);
|
||||
}
|
||||
|
||||
void Sql::GetColumn(SqlId colid, Ref r) const
|
||||
{
|
||||
String s = ~colid;
|
||||
for(int i = 0; i < cn->info.GetCount(); i++)
|
||||
if(cn->info[i].name == s) {
|
||||
GetColumn(i, r);
|
||||
return;
|
||||
}
|
||||
r.SetNull();
|
||||
}
|
||||
|
||||
Value Sql::operator[](int i) const {
|
||||
Value v;
|
||||
cn->GetColumn(i, v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue