# create stream that logs from a database
stream create --name processAccounts --definition "jdbc --url=jdbc:hsqldb:hsql://localhost:9002/ --query='select * from account' --username=sa --fixedDelay=100 | log" --deploy

# create stream that filters accounts with zero balance
stream create --name processAccounts --definition "jdbc --url=jdbc:hsqldb:hsql://localhost:9002/ --query='select * from account' --username=sa --fixedDelay=100 | filter --expression='payload.balance > 0.00'  | log" --deploy

# create stream that filters closed accounts 
stream create --name processAccounts --definition "jdbc --url=jdbc:hsqldb:hsql://localhost:9002/ --query='select * from account' --username=sa --fixedDelay=100 | filter --expression='payload.open == true'  | log" --deploy

# create stream that filters closed accounts and outputs to a file
stream create --name processAccounts --definition "jdbc --url=jdbc:hsqldb:hsql://localhost:9002/ --query='select * from account' --username=sa --fixedDelay=100 | filter --expression='payload.open == true'  | file --suffix=log" --deploy

# create stream that filters closed accounts and outputs to a file
# use the update option to only query new rows
stream create --name processAccounts --definition "jdbc --url=jdbc:hsqldb:hsql://localhost:9002/ --query='select * from account where newRow=true' --username=sa --fixedDelay=5  --update='update account set newRow=false where accountNum in (:accountNum)' | filter --expression='payload.open == true'  | file --suffix=log" --deploy
