Hi,
I'm opening this thread as I'm trying to achieve Geert's function to build an array from a query using JScript.
Below is the code that I currently have but I'm getting an error for line foreach (rowNode in rowList).
What I'd like to do is having a function similar to DBGetFieldValueArrayString in EAScriptLib.JScript-Database but for all columns returned by my query, not just one.
e.g. if I run "select object_ID, name, stereotype from t_object ...", I'd like to have a 2D array to read values for each row, and each field (result[0,0], result[0,1], result[1,0], result[1,1], etc.)
var queryResult = Repository.SQLQuery( sql );
if ( queryResult.length > 0 )
{
var resultDOM = XMLParseXML( queryResult );
if ( resultDOM ) {
var resultArray;
var rowList = resultDOM.selectNodes( "//EADATA//Dataset_0//Data//Row" );
var rowNode;
Session.Output(rowList.length);
if (rowList.length > 0) {
var i = 0;
foreach (rowNode in rowList)
{
Session.Output(i);
i++;
}
....