Search in sources :

Example 11 with FastsqlException

use of com.alibaba.druid.FastsqlException in project druid by alibaba.

the class SQLNCharExpr method output.

public void output(Appendable buf) {
    try {
        if ((this.text == null) || (this.text.length() == 0)) {
            buf.append("NULL");
            return;
        }
        buf.append("N'");
        buf.append(this.text.replaceAll("'", "''"));
        buf.append("'");
    } catch (IOException ex) {
        throw new FastsqlException("output error", ex);
    }
}
Also used : FastsqlException(com.alibaba.druid.FastsqlException) IOException(java.io.IOException)

Example 12 with FastsqlException

use of com.alibaba.druid.FastsqlException in project druid by alibaba.

the class SQLPropertyExpr method output.

public void output(Appendable buf) {
    try {
        this.owner.output(buf);
        buf.append(".");
        buf.append(this.name);
    } catch (IOException ex) {
        throw new FastsqlException("output error", ex);
    }
}
Also used : FastsqlException(com.alibaba.druid.FastsqlException) IOException(java.io.IOException)

Example 13 with FastsqlException

use of com.alibaba.druid.FastsqlException in project druid by alibaba.

the class SQLSetStatement method output.

public void output(Appendable buf) {
    try {
        buf.append("SET ");
        for (int i = 0; i < items.size(); ++i) {
            if (i != 0) {
                buf.append(", ");
            }
            SQLAssignItem item = items.get(i);
            item.output(buf);
        }
    } catch (IOException ex) {
        throw new FastsqlException("output error", ex);
    }
}
Also used : FastsqlException(com.alibaba.druid.FastsqlException) IOException(java.io.IOException) SQLCommentHint(com.alibaba.druid.sql.ast.SQLCommentHint)

Example 14 with FastsqlException

use of com.alibaba.druid.FastsqlException in project druid by alibaba.

the class SQLSelectItem method output.

public void output(Appendable buf) {
    try {
        if (this.connectByRoot) {
            buf.append(" CONNECT_BY_ROOT ");
        }
        this.expr.output(buf);
        if ((this.alias != null) && (this.alias.length() != 0)) {
            buf.append(" AS ");
            buf.append(this.alias);
        }
    } catch (IOException ex) {
        throw new FastsqlException("output error", ex);
    }
}
Also used : FastsqlException(com.alibaba.druid.FastsqlException) IOException(java.io.IOException)

Example 15 with FastsqlException

use of com.alibaba.druid.FastsqlException in project druid by alibaba.

the class SQLUpdateSetItem method output.

public void output(Appendable buf) {
    try {
        column.output(buf);
        buf.append(" = ");
        value.output(buf);
    } catch (IOException ex) {
        throw new FastsqlException("output error", ex);
    }
}
Also used : FastsqlException(com.alibaba.druid.FastsqlException) IOException(java.io.IOException)

Aggregations

FastsqlException (com.alibaba.druid.FastsqlException)22 IOException (java.io.IOException)16 DateString (org.apache.calcite.util.DateString)2 TimeString (org.apache.calcite.util.TimeString)2 TimestampString (org.apache.calcite.util.TimestampString)2 SQLCommentHint (com.alibaba.druid.sql.ast.SQLCommentHint)1 SQLName (com.alibaba.druid.sql.ast.SQLName)1 SQLObject (com.alibaba.druid.sql.ast.SQLObject)1 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)1 SQLColumnDefinition (com.alibaba.druid.sql.ast.statement.SQLColumnDefinition)1 SQLShowColumnsStatement (com.alibaba.druid.sql.ast.statement.SQLShowColumnsStatement)1 SQLShowCreateTableStatement (com.alibaba.druid.sql.ast.statement.SQLShowCreateTableStatement)1 MySqlCreateTableStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement)1 MySqlRenameTableStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlRenameTableStatement)1 SQLEvalVisitor (com.alibaba.druid.sql.visitor.SQLEvalVisitor)1 SqlTypeName (org.apache.calcite.sql.type.SqlTypeName)1