Search in sources :

Example 56 with SQLDataType

use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.

the class Oracle2PG_DataTypeTest_double method test_oracle2pg_binary_double.

public void test_oracle2pg_binary_double() throws Exception {
    String sql = "BINARY_DOUBLE";
    SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
    SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
    assertEquals("DOUBLE PRECISION", pgDataType.toString());
}
Also used : SQLDataType(com.alibaba.druid.sql.ast.SQLDataType)

Example 57 with SQLDataType

use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.

the class Oracle2PG_DataTypeTest_double method test_oracle2pg_binary_double_precision.

public void test_oracle2pg_binary_double_precision() throws Exception {
    String sql = "double precision";
    SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
    SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
    assertEquals("DOUBLE PRECISION", pgDataType.toString());
}
Also used : SQLDataType(com.alibaba.druid.sql.ast.SQLDataType)

Example 58 with SQLDataType

use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.

the class Oracle2PG_DataTypeTest_double method test_oracle2pg_binary_float.

public void test_oracle2pg_binary_float() throws Exception {
    String sql = "BINARY_FLOAT";
    SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
    SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
    assertEquals("REAL", pgDataType.toString());
}
Also used : SQLDataType(com.alibaba.druid.sql.ast.SQLDataType)

Example 59 with SQLDataType

use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.

the class Oracle2PG_DataTypeTest_int method test_oracle2pg_integer.

public void test_oracle2pg_integer() throws Exception {
    String sql = "integer";
    SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
    SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
    assertEquals("DECIMAL(38)", pgDataType.toString());
}
Also used : SQLDataType(com.alibaba.druid.sql.ast.SQLDataType)

Example 60 with SQLDataType

use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.

the class Oracle2PG_DataTypeTest_int method test_oracle2pg_int.

public void test_oracle2pg_int() throws Exception {
    String sql = "int";
    SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
    SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
    assertEquals("DECIMAL(38)", pgDataType.toString());
}
Also used : SQLDataType(com.alibaba.druid.sql.ast.SQLDataType)

Aggregations

SQLDataType (com.alibaba.druid.sql.ast.SQLDataType)97 SQLExpr (com.alibaba.druid.sql.ast.SQLExpr)8 SQLDataTypeImpl (com.alibaba.druid.sql.ast.SQLDataTypeImpl)7 SQLCharacterDataType (com.alibaba.druid.sql.ast.statement.SQLCharacterDataType)6 SQLAllColumnExpr (com.alibaba.druid.sql.ast.expr.SQLAllColumnExpr)4 SQLIntegerExpr (com.alibaba.druid.sql.ast.expr.SQLIntegerExpr)4 SQLColumnDefinition (com.alibaba.druid.sql.ast.statement.SQLColumnDefinition)4 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)3 SQLNumericLiteralExpr (com.alibaba.druid.sql.ast.expr.SQLNumericLiteralExpr)3 SQLVariantRefExpr (com.alibaba.druid.sql.ast.expr.SQLVariantRefExpr)3 SQLSelectStatement (com.alibaba.druid.sql.ast.statement.SQLSelectStatement)3 SQLName (com.alibaba.druid.sql.ast.SQLName)2 SQLSelectItem (com.alibaba.druid.sql.ast.statement.SQLSelectItem)2 SQLSelectQueryBlock (com.alibaba.druid.sql.ast.statement.SQLSelectQueryBlock)2 SQLCharExpr (com.alibaba.druid.sql.ast.expr.SQLCharExpr)1 SQLIdentifierExpr (com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr)1 SQLIntervalExpr (com.alibaba.druid.sql.ast.expr.SQLIntervalExpr)1 SQLMethodInvokeExpr (com.alibaba.druid.sql.ast.expr.SQLMethodInvokeExpr)1 SQLNullExpr (com.alibaba.druid.sql.ast.expr.SQLNullExpr)1 SQLAlterTableAlterColumn (com.alibaba.druid.sql.ast.statement.SQLAlterTableAlterColumn)1