Ok heres my scenario - i want to query a local db and store the results of the GUID select query into an array.
i would then like to query the remote server to return a result set which show basically any new records
This is the query but obviously this only works on the same server.
SELECT *
FROM remotetable remote
WHERE NOT EXISTS
(
SELECT 1
FROM localtable local
WHERE local.guid = remote.guid
)
and insert the results of this query into my local db to consolidate it.
so it would be something like
ArrayList myArrayList = new ArrayList();
OdbcConnection local = new OdbcConnection("DSN=local");
local.Open();
OdbcCommand guidSelect = new OdbcCommand("SELECT GUID from localtable",local);
OdbcDataReader DbReader = guidSelect.ExecuteReader();
while (DbReader.Read())
{
String guid = (string)DbReader[0];
myArrayList.Add(guid);
}
local.Close();
OdbcConnection local = new OdbcConnection("DSN=remote");
"SELECT * FROM remotetable remote WHERE NOT EXISTS (SELECT 1 FROM"+ myArrayList() +" local WHERE local.guid = remote.guid)
obviously this will not work as is but it should give a general overview what id like to accomplish
thanks in advance :)