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
| Methods inherited from class org.compiere.dbPort.Convert |
cleanUpStatement, convert, convertAll, convertIt, convertStatement, convertWithConvertMap, escapeQuotedString, execute, getConversionError, getConvertMap, getException, hasError, isOracle, logMigrationScript, recoverQuotedStrings, replaceQuotedStrings, setVerbose |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Convert_SQL92
public Convert_SQL92()
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
Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.