Click to See Complete Forum and Search --> : Retrieving data from 2 different databases


NinaWilliam
09-21-2005, 03:46 AM
I am trying to retrieve doctor data and appointment data from the database to bind and view them in the system, this is the SQL command that I used when the data was in the same sql database:

"SELECT Doctors.DoctorCorpNum, Appointments.AppointmentId, AppointmentStatus.AppointmentStatusId, Doctors.Name, Doctors.Phone, AppointmentStatus.AppointmentStatusName, Appointments.AppointDate FROM Appointments INNER JOIN AppointmentStatus ON Appointments.AppointmentStatusId = AppointmentStatus.AppointmentStatusId INNER JOIN Doctors ON Appointments.DoctorCorpNum = Doctors.DoctorCorpNum WHERE (Appointments.AppointDate = CONVERT(DATETIME, '" & date1 & "', 102)) AND ((Appointments.flgMarkDelete = 0) OR (Appointments.flgMarkDelete IS NULL)) ORDER BY " + str + ""

but now the doctor table is in Oracle database and the appointment table is in SQL database, how can I get the data from different databases? can I do that in one Command? or I should use 2 commands, one is sql command and the other is oracle command?

please help me, it is my first time to work with 2 databases in one system...

Regards,
Nina

silverbullet24
09-22-2005, 05:35 PM
right, one database per sql command. use 2 seperate ones and combine them after that

NinaWilliam
09-25-2005, 10:00 AM
oh really :0 ..how can i do that?