var SQL = new DataSource();
var dbo = SQL.connect('SQL19','user','pass');
s.log (1, "OK DB: "+ dbo);
var FStatement = new Statement( SQL);
var SQLcommand = "SELECT * FROM table WHERE job='111111'";
isSucces = FStatement.execute(SQLcommand);
s.log (1, "Command status: "+ isSucces);
var queryResult = sqlStatement.execute( SQLcommand);
if (queryResult == false) {
dsnConnection.disconnect();
throw "SQL query failed: "+ SQLcommand; //or some other error handling
}
var returnResult = new Array();
while (sqlStatement.isRowAvailable()) {
sqlStatement.fetchRow();
var field = sqlStatement.getString( column);
returnResult.push( field);
}
SQL.disconnect();
What database are you connecting to? I strongly advise against doing this in legacy! Or why not simply use the "Database connect" element?