I'm testing some functionalities about Foreign Tables and it works smoothly with PostgreSQL database, but I found out an issue with MySQL database, I followed the documentation:
Step 1: I've created my SQL Gateway connection to my MySQL database: **WARNING** if the name of the driver file is too long IRIS won't be able to get it.
Step 2: Create foreign server:
CREATE FOREIGN SERVER Test.MySQLDB FOREIGN DATA WRAPPER JDBC CONNECTION'MySQL'
Step 3: Create foreign table:
CREATE FOREIGN TABLE Test.PatientMySQL SERVER Test.MySQLDB TABLE 'patient'
[%msg: <Foreign Tables - ERROR #8104: Gateway Exception: <GATEWAY> java.sql.SQLSyntaxErrorException com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:112) Remote database reported error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"patient" T1' at line 1>]
As you can see, the problem is the double quotation used on the query for the table name that IRIS is executing, MySQL doesn't recognize it and throws the error, I've checked the driver and the MySQL versions and they match, version 9.
Hear long-time InterSystems partner Netsmart share its journey to a fully cloud-based delivery model. Netsmart Plexus Cloud offers a secure, HIPAA-compliant hosting option for its broad set of InterSystems-IRIS-based solutions, fully managed and monitored by Netsmart. Learn what architecture and technology choices Netsmart made, the challenges encountered along the way, and the benefits realized by its customers.
Presenters: 🗣 Mike Brand, EVP - Solution Development & Delivery, Netsmart 🗣 Tom Geis, VP - Cloud Technology Services, Netsmart