Search in sources :

Example 6 with AlterTrigger

use of org.teiid.query.sql.lang.AlterTrigger in project teiid by teiid.

the class TestParseAlter method testAlterDisabled.

@Test
public void testAlterDisabled() throws Exception {
    AlterTrigger alterTrigger = new AlterTrigger();
    alterTrigger.setTarget(new GroupSymbol("x"));
    alterTrigger.setEvent(TriggerEvent.UPDATE);
    alterTrigger.setEnabled(false);
    helpTest("alter trigger on x instead of update disabled", "ALTER TRIGGER ON x INSTEAD OF UPDATE DISABLED", alterTrigger);
}
Also used : GroupSymbol(org.teiid.query.sql.symbol.GroupSymbol) AlterTrigger(org.teiid.query.sql.lang.AlterTrigger) Test(org.junit.Test)

Example 7 with AlterTrigger

use of org.teiid.query.sql.lang.AlterTrigger in project teiid by teiid.

the class TestParseAlter method testAlterTrigger.

@Test
public void testAlterTrigger() throws Exception {
    AlterTrigger alterTrigger = new AlterTrigger();
    alterTrigger.setTarget(new GroupSymbol("x"));
    alterTrigger.setEvent(TriggerEvent.UPDATE);
    alterTrigger.setDefinition((TriggerAction) QueryParser.getQueryParser().parseProcedure("for each row begin end", true));
    helpTest("alter trigger on x instead of update as for each row begin end", "ALTER TRIGGER ON x INSTEAD OF UPDATE AS\nFOR EACH ROW\nBEGIN ATOMIC\nEND", alterTrigger);
}
Also used : GroupSymbol(org.teiid.query.sql.symbol.GroupSymbol) AlterTrigger(org.teiid.query.sql.lang.AlterTrigger) Test(org.junit.Test)

Aggregations

AlterTrigger (org.teiid.query.sql.lang.AlterTrigger)7 Test (org.junit.Test)6 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)5 QueryResolverException (org.teiid.api.exception.query.QueryResolverException)1 TriggerEvent (org.teiid.metadata.Table.TriggerEvent)1 Alter (org.teiid.query.sql.lang.Alter)1 AlterProcedure (org.teiid.query.sql.lang.AlterProcedure)1 Command (org.teiid.query.sql.lang.Command)1