I currently have 2 ODBC connections set up on my web server. One that connects to the our enterprise QAD database and another that connects to our custom database used to extend our database. In this paticular example I have my employee records in the QAD database, and then an employee number in another table in the custom database.
Is there any way for me to set up a cross join between the two odbc connections in php so that I don’t have to loop through the results of the first query and send several queries based on the returned results to tie my records together in a php array?
The best i’ve been able to come up with is to build an IN clause from my first query from our custom database, send the second query to the QAD database, and then do an array merge in php. However, this is an extremely slow process compared to a normal SQL join.
Not sure if you’ve already found a solution to this but there is a Progress article on how to do this.
Quick Guide To Setting Up MultiDatabase ODBC Connectivity
I had a similar requirement – I wanted to create a join between a table in the primary QAD database and a custom table in our custom database. I have tested this and it works well although my setup is slightly different. I needed to connect to QAD from Microsoft SSRS to create reports against the QAD data – I needed to create some reports that the standard QAD report designer could not handle.
I have tested this on Progress 10.1c (this method is only supported in 10.1b+).
So the steps I took were:
I believe it is important that the bit versions of the OS/Database and the ODBC drivers match but haven’t confirmed this yet.
Whilst my requirement is different to your’s ultimately it’s the QAD server config and ODBC setup that’s key. As long as your PHP client can perform a similar capability in terms of the OpenQuery command then you may get this working. I don’t have any experience with PHP so can’t help you there.
It seems a bit convoluted but actually works very well and in a lot of cases actually outperforms querying data using QAD browses!
Hope this helps.
Edit:
Here’s a sample of an OpenQuery command – you can see that the table joins work in the normal way but just require and additional piece in the table reference.
Then just access the view using normal SQL syntax.