I have a grid with ID, Name columns.
Now in order to populate this grid I have to do 2 queries from DB.
So I select id and name from 1st table and set the dgData of group "TestGrid" to array1 ....
This works perfectly and data from 1st table will be in grid.
Next step is to populate this grid from 2nd table.
So I have again select id and name from 2nd table and set the dgData of group "TestGrid" to array2
Issue is that I will overwrite data from 1st query by 2nd query.
Code:
Code: Select all
--table1 selection
put "SELECT id,name FROm table1" into tSQL
put revQueryDatabase(gConnectionID, tSQL) into theCursor
if theCursor is an integer then
ConvertSQLCursorToArray theCursor, listArray
put the result into theError
if theError is empty then
set the dgData of group "TestGrid" to listArray
else
answer theError
end if
revCloseCursor theCursor
end if
--table2 selection
put "SELECT id,name FROM table2 " into tSQL
put revQueryDatabase(gConnectionID, tSQL) into theCursor
if theCursor is an integer then
ConvertSQLCursorToArray theCursor, listArray
put the result into theError
if theError is empty then
set the dgData of group "TestGrid" to listArray
else
answer theError
end if
revCloseCursor theCursor
end if