Changes between Version 10 and Version 11 of Docs/Prog/Manual/ApplicationLibraries/lib825db


Ignore:
Timestamp:
10/23/25 07:19:38 (3 weeks ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825db

    v10 v11  
    6767}}}
    6868To support both SQLite and MySQL the brackets must be removed from table and field names in SQL statements.
     69
     70Existing apps will have code such as:
     71{{{
     72string sql = "SELECT * FROM [railcars] WHERE [ID] = '" + strId + "';";
     73statement st(db, sql);
     74cursor cur(st.get_cursor());
     75if(cur.step() == SQLITE_ROW) {
     76   cur.get("ID", curRailcar.strId);
     77   cur.get("Target", curRailcar.target);
     78}
     79}}}
     80
     81Replace with:
     82Existing apps will have code such as:
     83{{{
     84string sql = "SELECT * FROM railcars WHERE ID = '" + strId + "';";
     85CDBStatement stmt(appDB, sql);
     86if(stmt.Step() == DBSQL_ROW) {
     87   stmt.Get("ID", curRailcar.strId);
     88   stmt.Get("Target", curRailcar.target);
     89}
     90}}}
     91
     92