SuperComputing
IS-IT--Management
I apologize in advance, there's at least 3 forums this could fall into
My company has a psql based program that stores 'customers' in a local database. Our offsite website has a MySQL database that stores SOME of those customers as 'dealers'. There is a flag in the local table that specifies which 'customers' should be in the 'dealers' table. Both tables have a column called 'CustomerNumber' that identifies the customers/dealers. I have written a local asp page that will display all of the customers, and all of the dealers.
What I need to do is be able to display the differences between the 2 sets of CustomerNumbers. Mainly, which ones that are local that are not on the remote, and secondly, the ones that are remote that are not local. Can this be accomplished without a painstakingly slow loop? Is there a way that I can pull the data, then compare it?
Thanks in advance!
My company has a psql based program that stores 'customers' in a local database. Our offsite website has a MySQL database that stores SOME of those customers as 'dealers'. There is a flag in the local table that specifies which 'customers' should be in the 'dealers' table. Both tables have a column called 'CustomerNumber' that identifies the customers/dealers. I have written a local asp page that will display all of the customers, and all of the dealers.
What I need to do is be able to display the differences between the 2 sets of CustomerNumbers. Mainly, which ones that are local that are not on the remote, and secondly, the ones that are remote that are not local. Can this be accomplished without a painstakingly slow loop? Is there a way that I can pull the data, then compare it?
Thanks in advance!
Code:
Set LocalConn = Server.CreateObject("ADODB.Connection")
LocalConn.Open = "DSN=CPDATA;"
Set RemoteConn = Server.CreateObject("ADODB.Connection")
RemoteConn.Open = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword
Customers = "SELECT CustomerNumber FROM Customer WHERE Flag = 'Y' "
Dealers = "SELECT CustomerNumber FROM Dealers"
Set rsCustomers = LocalConn.Execute(Customers)
Set rsDealers = RemoteConn.Execute(Dealers)
for each x in rsDealers.Fields
Response.Write(x.name)
next
do until rsDealers.EOF
for each x in rsDealers.Fields
Response.Write(x.value)
etc... etc..