Home » U++ Library support » U++ SQL » Handling multiple rows data in sqlite3
Handling multiple rows data in sqlite3 [message #12783] |
Fri, 16 November 2007 03:53 |
fuqr
Messages: 16 Registered: July 2007 Location: Singapore
|
Promising Member |
|
|
Dear UPP experts,
I'm quite new for UPP. I have got very useful references from "HomeBudget" about sqlite3 application. One of my question is:
when I use the code below, data of multiple rows can be passed to GridCtrl:
" SQL & ::Select(NAME, TOTAL).From(GROUPS).Where(GT_ID == dtid);
while(SQL.Fetch()) mostpr.Add(SQL); "
But my following code handles first row only when I try to update value of last column using data from other columns in the same row/line and the previous rows/lines:
====================================================
double vsi21=1, bi=1, bi2=1, mbi2;
SQL & ::Select(CAT_ID,S21,S22).From(CATEGORIES)
.Where(CS_ID == cid && GR_ID == gid);
while(SQL.Fetch())
{
double vs22 = SQL[S22];
double vs21 = SQL[S21];
int k = SQL[0];
bi2 = bi*vsi21;
mbi2 = bi2*bi2*vs22*gammer*dbfactor;
mbi2 = mbi2*mbi2;
bi = bi2;
vsi21 = vs21;
SQL & ::Update(CATEGORIES)(MBI, mbi2)
.Where(CS_ID == cid && GR_ID == gid && CAT_ID == k);
}
================================
If any mistakes in my code or any other simple way to handle it?
I failed to found any detail manuals in UPP especially for GridCtrl & sql database:).
Thanks in advance for your help.
Qinrong
|
|
|
Goto Forum:
Current Time: Tue May 14 00:51:15 CEST 2024
Total time taken to generate the page: 0.02171 seconds
|