From bf82506c1b0cf788bfb0180af7e6ee1112c91fdd Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 15 Feb 2013 17:34:12 +0100 Subject: [PATCH] Oracle can't enclose table names with double quotations --- lib/core/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index 6091f7e98..2379bae9f 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2818,7 +2818,9 @@ def safeSQLIdentificatorNaming(name, isTable=False): if retVal.upper() in kb.keywords or not re.match(r"\A[A-Za-z0-9_@%s\$]+\Z" % ("." if _ else ""), retVal): # MsSQL is the only DBMS where we automatically prepend schema to table name (dot is normal) if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.ACCESS): retVal = "`%s`" % retVal.strip("`") - elif Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.PGSQL, DBMS.DB2): + elif Backend.getIdentifiedDbms() in (DBMS.ORACLE,) and not isTable: + retVal = "\"%s\"" % retVal.strip("\"") + elif Backend.getIdentifiedDbms() in (DBMS.PGSQL, DBMS.DB2): retVal = "\"%s\"" % retVal.strip("\"") elif Backend.getIdentifiedDbms() in (DBMS.MSSQL,): retVal = "[%s]" % retVal.strip("[]")