<li>''ElTp cfg( string nm )'' — gets the value of the configuration field ''nm'' of the object.</li>
<li>''ElTp cfg( string nm )'' — gets the value of the configuration field ''nm'' of the object.</li>
<li>''bool cfgSet( string nm, ElTp val )'' [<span style='color:red'>access to the appropriate subsystem</span>] — sets the configuration field ''nm'' of the object to the value ''val''.</li>
<li>''bool cfgSet( string nm, ElTp val )'' [<span style='color:red'>access to the appropriate subsystem</span>] — sets the configuration field ''nm'' of the object to the value ''val''.</li>
−
<li>''Array SQLReq( string req, bool tr = EVAL );'' — performs the SQL-request ''req'' to the DB, inside (''tr''=true), outside (''tr''=false) or no matter (''tr''=EVAL) to the transaction. Returns an array of rows of the result table with the fields both per indexes and column names. At an error the result property "err" sets to the error value.
+
<li>''Array SQLReq( string req, bool tr = '''EVAL''' );'' — performs the SQL-request ''req'' to the DB, inside (''tr''=true), outside (''tr''=false) or no matter (''tr''='''EVAL''') to the transaction. Returns an array of rows of the result table with the fields both per indexes and column names. At an error the result property "err" sets to the error value.
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
DBTbl = SYS.BD.MySQL.GenDB.SQLReq("SELECT * from DB;");
DBTbl = SYS.BD.MySQL.GenDB.SQLReq("SELECT * from DB;");
Latest revision as of 17:14, 11 May 2025
Subsystem "DB" (SYS.BD)
Functions of the database object (SYS.BD["TypeDB"]["DB"]):
ElTp cfg( string nm ) — gets the value of the configuration field nm of the object.
bool cfgSet( string nm, ElTp val ) [access to the appropriate subsystem] — sets the configuration field nm of the object to the value val.
Array SQLReq( string req, bool tr = EVAL ); — performs the SQL-request req to the DB, inside (tr=true), outside (tr=false) or no matter (tr=EVAL) to the transaction. Returns an array of rows of the result table with the fields both per indexes and column names. At an error the result property "err" sets to the error value.
DBTbl=SYS.BD.MySQL.GenDB.SQLReq("SELECT * from DB;");if(DBTbl.err.length)SYS.messInfo("TEST DB","Error: "+DBTbl.err);elsefor(variRw=0;iRw<DBTbl.length;iRw++){varrec="";for(variFld=0;iFld<DBTbl[iRw].length;iFld++)rec+=DBTbl[iRw][iFld]+"\t";SYS.messInfo("TEST DB","Row "+iRw+": "+rec);//Get column value by the nameif(iRw)SYS.messInfo("TEST DB","Row "+iRw+": 'NAME'"+DBTbl[iRw]["NAME"]);}