Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Handling multiple rows data in sqlite3
Re: Handling multiple rows data in sqlite3 [message #12784 is a reply to message #12783] Fri, 16 November 2007 08:29 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

You can't use SQL object inside outer SQL.Fetch(). Transform your code to:
double vsi21=1, bi=1, bi2=1, mbi2;

SQL & ::Select(CAT_ID,S21,S22).From(CATEGORIES)
.Where(CS_ID == cid && GR_ID == gid);

Sql q_upd(::Update(CATEGORIES)(MBI, SqlArg())
.Where(CS_ID == cid && GR_ID == gid && CAT_ID == SqlArg()),
SQL.GetSession());

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;

q_upd.Run(mbi2, k);
}
 
Read Message
Read Message
Read Message
Previous Topic: Returning a null from select
Next Topic: [SQLite] db.Open() crashes app
Goto Forum:
  


Current Time: Fri Jul 18 10:54:21 CEST 2025

Total time taken to generate the page: 0.04023 seconds