Package org.h2.value

Examples of org.h2.value.Value.convertTo()


            }
            if (expr == null && argList.length % 2 == 0) {
                expr = argList[argList.length - 1];
            }
            Value v = expr == null ? ValueNull.INSTANCE : expr.getValue(session);
            result = v.convertTo(dataType);
            break;
        }
        case NVL2: {
            Expression expr;
            if (v0 == ValueNull.INSTANCE) {
View Full Code Here


                expr = argList[2];
            } else {
                expr = argList[1];
            }
            Value v = expr.getValue(session);
            result = v.convertTo(dataType);
            break;
        }
        case COALESCE: {
            result = v0;
            for (int i = 0; i < argList.length; i++) {
View Full Code Here

        case COALESCE: {
            result = v0;
            for (int i = 0; i < argList.length; i++) {
                Value v = i == 0 ? v0 : argList[i].getValue(session);
                if (!(v == ValueNull.INSTANCE)) {
                    result = v.convertTo(dataType);
                    break;
                }
            }
            break;
        }
View Full Code Here

        case LEAST: {
            result = ValueNull.INSTANCE;
            for (int i = 0; i < argList.length; i++) {
                Value v = i == 0 ? v0 : argList[i].getValue(session);
                if (!(v == ValueNull.INSTANCE)) {
                    v = v.convertTo(dataType);
                    if (result == ValueNull.INSTANCE) {
                        result = v;
                    } else {
                        int comp = database.compareTypeSave(result, v);
                        if (info.type == GREATEST && comp < 0) {
View Full Code Here

                expr = argList[2];
            } else {
                expr = argList[1];
            }
            Value v = expr.getValue(session);
            result = v.convertTo(dataType);
            break;
        }
        case DECODE: {
            Expression expr = null;
            for (int i = 1; i < argList.length - 1; i += 2) {
View Full Code Here

            }
            if (expr == null && argList.length % 2 == 0) {
                expr = argList[argList.length - 1];
            }
            Value v = expr == null ? ValueNull.INSTANCE : expr.getValue(session);
            result = v.convertTo(dataType);
            break;
        }
        case NVL2: {
            Expression expr;
            if (v0 == ValueNull.INSTANCE) {
View Full Code Here

                expr = argList[2];
            } else {
                expr = argList[1];
            }
            Value v = expr.getValue(session);
            result = v.convertTo(dataType);
            break;
        }
        case COALESCE: {
            result = v0;
            for (int i = 0; i < argList.length; i++) {
View Full Code Here

        case COALESCE: {
            result = v0;
            for (int i = 0; i < argList.length; i++) {
                Value v = i == 0 ? v0 : argList[i].getValue(session);
                if (!(v == ValueNull.INSTANCE)) {
                    result = v.convertTo(dataType);
                    break;
                }
            }
            break;
        }
View Full Code Here

        case LEAST: {
            result = ValueNull.INSTANCE;
            for (int i = 0; i < argList.length; i++) {
                Value v = i == 0 ? v0 : argList[i].getValue(session);
                if (!(v == ValueNull.INSTANCE)) {
                    v = v.convertTo(dataType);
                    if (result == ValueNull.INSTANCE) {
                        result = v;
                    } else {
                        int comp = database.compareTypeSave(result, v);
                        if (info.type == GREATEST && comp < 0) {
View Full Code Here

    public ResultInterface query(int maxrows) {
        setCurrentRowNumber(1);
        Value v = expression.getValue(session);
        if (isResultSet) {
            v = v.convertTo(Value.RESULT_SET);
            ResultSet rs = v.getResultSet();
            return LocalResult.read(session, rs, maxrows);
        }
        LocalResult result = new LocalResult(session, expressions, 1);
        Value[] row = { v };
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.