Groovy web console

subscribe to the feed Subscribe
to this
site

exemplo

Published 1 week ago by Lucas
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def dbs = 'a b c'.split(' ') 
def query = ''
def formatQuery = { db -> "DROP DATABASE ${db}; CREATE DATABASE ${db}; "}

for( db in dbs ) {
    query = query + formatQuery(db)
}

println query