Class Convert_PostgreSQL


  • public class Convert_PostgreSQL
    extends Convert_SQL92
    Convert Oracle SQL to PostgreSQL SQL
    Author:
    Victor Perez, Low Heng Sin, Carlos Ruiz, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1824256 ] Convert sql casts
    • Field Detail

      • REGEX_FLAGS

        public static final int REGEX_FLAGS
        RegEx: insensitive and dot to include line end characters
        See Also:
        Constant Field Values
    • Constructor Detail

      • Convert_PostgreSQL

        public Convert_PostgreSQL()
        Constructor
    • Method Detail

      • isOracle

        public boolean isOracle()
        Is Oracle DB
        Specified by:
        isOracle in class Convert
        Returns:
        true if connection is Oracle DB
      • convertStatement

        protected ArrayList<String> convertStatement​(String sqlStatement)
        Convert single Statements. - remove comments - process FUNCTION/TRIGGER/PROCEDURE - process Statement
        Specified by:
        convertStatement in class Convert
        Parameters:
        sqlStatement -
        Returns:
        converted statement
      • convertOracleStatement

        public String convertOracleStatement​(String sqlStatement)
        Convert Oracle SQL statement to PostgreSQL syntax
        Parameters:
        sqlStatement - oracle sql statement
        Returns:
        PostgreSQL statement
      • escapeQuotedString

        protected String escapeQuotedString​(String in)
        Description copied from class: Convert
        hook for database specific escape of quoted string ( if needed )
        Overrides:
        escapeQuotedString in class Convert
        Returns:
        string
      • convertComplexStatement

        protected String convertComplexStatement​(String sqlStatement)
        Converts Decode and Outer Join.
                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