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 » Is this correct?
Re: Is this correct? [message #8586 is a reply to message #8581] Tue, 20 March 2007 10:12 Go to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
MikeyV wrote on Mon, 19 March 2007 20:44

Quote:

Did you SQL.Fetch()?



No, I wasn't sure how. Is it like:
SQL * Select(SqlSum(PS)).From(AreaMission);
while(SQL.Fetch())
    x += SQL[0];




Yes Smile

Sure, we still owe everybody the nice SQL tutorial...

BTW, while above code is OK, I do not recommend using SQL with Fetch - it is global variable and way too often you can make a mistake here (by issuing another query on the same SQL).

So if you are going to Fetch, rather use:

Sql sql;
sql * Select(...
while(sql.Fetch())


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: An improvement to SqlArray::PerformInsert
Next Topic: Sqlite3 Forcing creating a database
Goto Forum:
  


Current Time: Sun Aug 24 15:37:48 CEST 2025

Total time taken to generate the page: 0.03744 seconds