Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f293af

Browse files
author
Miroslav Stampar
committed
Proper escaping for SQL identificators in Oracle (also, revert for 9b5f335)
1 parent f817105 commit 7f293af

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/core/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2820,6 +2820,8 @@ def safeSQLIdentificatorNaming(name, isTable=False):
28202820
retVal = "`%s`" % retVal.strip("`")
28212821
elif Backend.getIdentifiedDbms() in (DBMS.PGSQL, DBMS.DB2):
28222822
retVal = "\"%s\"" % retVal.strip("\"")
2823+
elif Backend.getIdentifiedDbms() in (DBMS.ORACLE,):
2824+
retVal = "\"%s\"" % retVal.strip("\"").upper()
28232825
elif Backend.getIdentifiedDbms() in (DBMS.MSSQL,):
28242826
retVal = "[%s]" % retVal.strip("[]")
28252827

@@ -2838,8 +2840,10 @@ def unsafeSQLIdentificatorNaming(name):
28382840
if isinstance(name, basestring):
28392841
if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.ACCESS):
28402842
retVal = name.replace("`", "")
2841-
elif Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.PGSQL, DBMS.DB2):
2843+
elif Backend.getIdentifiedDbms() in (DBMS.PGSQL, DBMS.DB2):
28422844
retVal = name.replace("\"", "")
2845+
elif Backend.getIdentifiedDbms() in (DBMS.ORACLE,):
2846+
retVal = name.replace("\"", "").upper()
28432847
elif Backend.getIdentifiedDbms() in (DBMS.MSSQL,):
28442848
retVal = name.replace("[", "").replace("]", "")
28452849

0 commit comments

Comments
 (0)