Forum Discussion
agvillamizar
13 years agoNew Contributor
I could do it with scripting test
Thank for answer
i got the result set for the first parameterized query and then, iterated it. for each row, i made a second query for comparing the two fields of the tables.
i had to create two connections to the same string connection for executing both query, the question is that if there is a way to execute different query using the same connection?
thanks
//////////////////////////////////////////////////////////////////////
var Qry;
Qry = ADO.CreateADOQuery();
Qry.ConnectionString = "Provider=IBMDA400.DataSource.1;Password=xxx;"+
"Persist Security Info=True;User ID=xxx;Data Source=xxxx";
var query= "Select* from table where date between " + param1 + " and " + param2;
Qry.SQL = query;
Qry.Open();
Qry.First();
while (! Qry.EOF)
{
var Qry2;
Qry2 = ADO.CreateADOQuery();
Qry2.ConnectionString = "Provider=IBMDA400.DataSource.1;Password=xxx;"+
"Persist Security Info=True;User ID=xxx;Data Source=xxxx";
var query= "Select* from table2 where field = " + Qry.FieldByName("xxx").Value;
Qry2.SQL = query;
Qry2.Open();
Qry2.First();
while (! Qry2.EOF)
{
//Comparing
aqObject.CompareProperty(Qry.FieldByName("xxx").Value, cmpEqual, Qry2.FieldByName("xxx").Value, true, 3);
Qry2.Next();
};
Qry2.Close();
Qry.Next();
};
Qry.Close();
Thank for answer
i got the result set for the first parameterized query and then, iterated it. for each row, i made a second query for comparing the two fields of the tables.
i had to create two connections to the same string connection for executing both query, the question is that if there is a way to execute different query using the same connection?
thanks
//////////////////////////////////////////////////////////////////////
var Qry;
Qry = ADO.CreateADOQuery();
Qry.ConnectionString = "Provider=IBMDA400.DataSource.1;Password=xxx;"+
"Persist Security Info=True;User ID=xxx;Data Source=xxxx";
var query= "Select* from table where date between " + param1 + " and " + param2;
Qry.SQL = query;
Qry.Open();
Qry.First();
while (! Qry.EOF)
{
var Qry2;
Qry2 = ADO.CreateADOQuery();
Qry2.ConnectionString = "Provider=IBMDA400.DataSource.1;Password=xxx;"+
"Persist Security Info=True;User ID=xxx;Data Source=xxxx";
var query= "Select* from table2 where field = " + Qry.FieldByName("xxx").Value;
Qry2.SQL = query;
Qry2.Open();
Qry2.First();
while (! Qry2.EOF)
{
//Comparing
aqObject.CompareProperty(Qry.FieldByName("xxx").Value, cmpEqual, Qry2.FieldByName("xxx").Value, true, 3);
Qry2.Next();
};
Qry2.Close();
Qry.Next();
};
Qry.Close();