Package org.teiid.query.sql.symbol

Examples of org.teiid.query.sql.symbol.Function


    @Test public void testTimestampaddFunctionMinute() {
        GroupSymbol g = new GroupSymbol("my.group1"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_MINUTE"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);
View Full Code Here


    @Test public void testTimestampaddFunctionHour() {
        GroupSymbol g = new GroupSymbol("my.group1"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_HOUR"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);
View Full Code Here

    @Test public void testTimestampaddFunctionDay() {
        GroupSymbol g = new GroupSymbol("my.group1"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_DAY"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);
View Full Code Here

    @Test public void testTimestampaddFunctionWeek() {
        GroupSymbol g = new GroupSymbol("my.group1"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_WEEK"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);
View Full Code Here

    @Test public void testTimestampaddFunctionQuarter() {
        GroupSymbol g = new GroupSymbol("my.group1"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_QUARTER"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);
View Full Code Here

    @Test public void testTimestampaddFunctionYear() {
        GroupSymbol g = new GroupSymbol("my.group1"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_YEAR"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);
View Full Code Here

    @Test public void testTimestampdiffFunctionFracSecond() {
        GroupSymbol g = new GroupSymbol("my.group1"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("timestampdiff", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_FRAC_SECOND"), new Constant("2003-05-01 10:20:10"), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);
View Full Code Here

    @Test public void testArithmeticOperatorPrecedence1() {
        GroupSymbol g = new GroupSymbol("g"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("+", new Expression[] {new Constant(new Integer(5)), new Constant(new Integer(2))}); //$NON-NLS-1$
        Function f2 = new Function("+", new Expression[] {f, new Constant(new Integer(3))}); //$NON-NLS-1$
        ExpressionSymbol es = new ExpressionSymbol("expr", f2); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(es);

        Query query = new Query();
View Full Code Here

    @Test public void testArithmeticOperatorPrecedence2() {
        GroupSymbol g = new GroupSymbol("g"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("+", new Expression[] {new Constant(new Integer(5)), new Constant(new Integer(2))}); //$NON-NLS-1$
        Function f2 = new Function("-", new Expression[] {f, new Constant(new Integer(3))}); //$NON-NLS-1$
        ExpressionSymbol es = new ExpressionSymbol("expr", f2); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(es);

        Query query = new Query();
View Full Code Here

    @Test public void testArithmeticOperatorPrecedence3() {
        GroupSymbol g = new GroupSymbol("g"); //$NON-NLS-1$
        From from = new From();
        from.addGroup(g);

        Function f = new Function("*", new Expression[] {new Constant(new Integer(2)), new Constant(new Integer(3))}); //$NON-NLS-1$
        Function f2 = new Function("+", new Expression[] {new Constant(new Integer(5)), f}); //$NON-NLS-1$
       
        ExpressionSymbol es = new ExpressionSymbol("expr", f2); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(es);

View Full Code Here

TOP

Related Classes of org.teiid.query.sql.symbol.Function

Copyright © 2018 www.massapicom. 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.