This topic is locked
[SOLVED]

 PHP-Runner 9.8 Ent. multiple DB connections

2/15/2019 4:29:17 AM
PHPRunner General questions
C
ckranich authorDevClub member

Hello All,
I hava a project where I have multiple database connections.

(3x MSSQLServer(3 Dataases on same server) and locally a MariaDB))
On some forms, tables on other connections can be accessed (used in SQL-Queries)

but not in others (Table not found), even if I use a full qualified table path

(Connection.db.Tablename) as I read in other post.
Could it be a problem that 3 connections go to same MSSQL server and therefore

sometimes the access takes the wrong database and therefore doesn't find

the table?
Has anybody else noticed similar issues?
Kind Regards,
ckranich

admin 2/16/2019

I'm afraid you doing it wrong. There is no such thing as Connection.db.Tablename. Connection is another level of abstraction, it is not something that you can use in your SQL Query.
If you have three databases on the same SQL Server you just need a single database connection. In your SQL queries you just use database.schema.tablename to access any table in any database. Of course you need to make sure that database user has access to all three databases. You need to test all your queries outside of PHPRunner first and once they work you can use them in PHPRunner as well.
And, of course, in MySQL query you cannot access SQL Server table and vice versa. That goes without saying.

C
ckranich authorDevClub member 2/17/2019



I'm afraid you doing it wrong. There is no such thing as Connection.db.Tablename. Connection is another level of abstraction, it is not something that you can use in your SQL Query.
If you have three databases on the same SQL Server you just need a single database connection. In your SQL queries you just use database.schema.tablename to access any table in any database. Of course you need to make sure that database user has access to all three databases. You need to test all your queries outside of PHPRunner first and once they work you can use them in PHPRunner as well.
And, of course, in MySQL query you cannot access SQL Server table and vice versa. That goes without saying.


Many Thanks, that clarified things :-)

  • In fact, I wanted to combine a mySQL query with a MS-SQL query (to fetch a article name from a central MS-SQL DB while using

    mySQL locally...
    Kind Regards,

    ckranich

admin 2/17/2019

I see what you saying. It is simply impossible to query two different databases in a single SQL query.
What you can do is to use 'View as' Custom and query that SQL Server database to retrieve and display article name.