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 » Please help the SQL-challenged
Re: Please help the SQL-challenged [message #9585 is a reply to message #9566] Fri, 18 May 2007 10:16 Go to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
Sounds quite OK to me.


SQL * Insert(CATEGORIES)
           (CAT_ID, some_value);

SQL * Update(CATEGORIES)(CAT_ID, update_value).Where(ID == key);

Sql sql;
sql * Select(ID, CAT_ID).From(CATEGORIES).Where(... some condition ...);

now the loop can look like

int id, cat_id;
while(sql.Fetch(id, cat_id)) ...

or

while(sql.Fetch()) { .. sql[ID] .. sql[0] .. }

(you can use either ids or indexes).

Alternatively, you can use S_CATEGORIES structure to work with the whole record.

 
Read Message
Read Message
Previous Topic: Sql::Execute()
Next Topic: SQL "AS" for PostgreSQL fixed
Goto Forum:
  


Current Time: Mon Aug 25 17:18:13 CEST 2025

Total time taken to generate the page: 0.06288 seconds