#94 BUG: wxARG 1.2.0-rc3 & Firebird

open
wxARG (3)
5
2012-12-15
2009-10-29
Anonymous
No

In wxActiveRecordGenerator when working with FireBird class wxActiveRecordGenerator in methods Prepare discovered bug:
Run the query:
===
wxString Query = wxString:: Format (wxT ( "SELECT * FROM% s LIMIT 1"), table. c_str ());
DatabaseResultSet * result = m_database-> ExecuteQuery (query);
===

For FireBird leads to an error "-104: Invalid token", since the keyword LIMIT is not supported by the FireBird.

For Corrections should:
Lines 100 and 145 module wxActiveRecordGenerator line
===
wxString Query = wxString:: Format (wxT ( "SELECT * FROM% s LIMIT 1"), table. c_str ());
/ / ..... and ....
wxString Query = wxString:: Format (wxT ( "SELECT FIRST 1 * FROM% s"), node. m_tableName. c_str ());
===

Replace respectively

wxString Query;
if ((AR_FIREBIRD == m_dbType)
| | (AR_FIREBIRD_EMBEDDED == m_dbType))
(
Query = wxString:: Format (wxT ( "SELECT FIRST 1 * FROM% s"), table. c_str ());
)
else
(
Query = wxString:: Format (wxT ( "SELECT * FROM% s LIMIT 1"), table. c_str ());
)

/ / ..... and ....

wxString Query;
if ((AR_FIREBIRD == m_dbType)
| | (AR_FIREBIRD_EMBEDDED == m_dbType))
(
Query = wxString:: Format (wxT ( "SELECT FIRST 1 * FROM% s"), node. m_tableName. c_str ());
)
else
(
Query = wxString:: Format (wxT ( "SELECT * FROM% s LIMIT 1"), node. m_tableName. c_str ());
)
===

Discussion