Package org.compiere.dbPort
Class Convert_SQL92
- java.lang.Object
-
- org.compiere.dbPort.Convert
-
- org.compiere.dbPort.Convert_SQL92
-
- Direct Known Subclasses:
Convert_PostgreSQL
public abstract class Convert_SQL92 extends Convert
Convert from oracle syntax to sql 92 standard- Author:
- Low Heng Sin
-
-
Field Summary
-
Fields inherited from class org.compiere.dbPort.Convert
m_conversionError, m_exception, m_stmt, m_verbose, REGEX_FLAGS
-
-
Constructor Summary
Constructors Constructor Description Convert_SQL92()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
convertDecode(String sqlStatement, int fromIndex)
Converts Decode.protected String
convertDelete(String sqlStatement)
Converts Delete.protected String
convertOuterJoin(String sqlStatement)
Convert Outer Join.protected boolean
isOperator(char c)
Is character a valid sql operator-
Methods inherited from class org.compiere.dbPort.Convert
cleanUpStatement, convert, convertAll, convertIt, convertStatement, convertWithConvertMap, escapeQuotedString, execute, getConversionError, getConvertMap, getException, hasError, isLogMigrationScript, isOracle, logMigrationScript, recoverQuotedStrings, replaceQuotedStrings, setVerbose
-
-
-
-
Method Detail
-
convertOuterJoin
protected String convertOuterJoin(String sqlStatement)
Convert Outer Join. Converting joins can ve very complex when multiple tables/keys are involved. The main scenarios supported are two tables with multiple key columns and multiple tables with single key columns.SELECT a.Col1, b.Col2 FROM tableA a, tableB b WHERE a.ID=b.ID(+) => SELECT a.Col1, b.Col2 FROM tableA a LEFT OUTER JOIN tableB b ON (a.ID=b.ID) SELECT a.Col1, b.Col2 FROM tableA a, tableB b WHERE a.ID(+)=b.ID => SELECT a.Col1, b.Col2 FROM tableA a RIGHT OUTER JOIN tableB b ON (a.ID=b.ID) Assumptions: - No outer joins in sub queries (ignores sub-queries) - OR condition ignored (not sure what to do, should not happen) Limitations: - Parameters for outer joins must be first - as sequence of parameters changes
- Parameters:
sqlStatement
-- Returns:
- converted statement
-
convertDecode
protected String convertDecode(String sqlStatement, int fromIndex)
Converts Decode.DECODE (a, 1, 'one', 2, 'two', 'none') => CASE WHEN a = 1 THEN 'one' WHEN a = 2 THEN 'two' ELSE 'none' END
- Parameters:
sqlStatement
-- Returns:
- converted statement
-
convertDelete
protected String convertDelete(String sqlStatement)
Converts Delete.DELETE C_Order i WHERE => DELETE FROM C_Order WHERE
- Parameters:
sqlStatement
-- Returns:
- converted statement
-
isOperator
protected boolean isOperator(char c)
Is character a valid sql operator- Parameters:
c
-- Returns:
- boolean
-
-