SQL table name with spaces |
Hello,
I have to connect to another database to retrieve data from there. In this database, table names contain spaces, hyphens and other extra characters (ex. $). Used DB driver SQLSRV. See it query: $db->table('Company Central-Europe Kft$SMS_NAV_IF')->select('Status')->getCompiledSelect(); Result: SELECT "Status" FROM "Company_Live"."dbo"."Company" Central-Europe" "Kft$SMS_NAV_IF" This query will of course return an error. Because of this: "Company" Central-Europe" "Kft$SMS_NAV_IF" The query builder splits the table name. My question is, is there a nice solution to make this work?
(06-06-2022, 01:24 AM)kovijanny Wrote: In this database, table names contain spaces, hyphens and other extra characters (ex. $). Some people just like to look for trouble! I think iRedds is right, just use raw queries since you have a weird setup.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |