sqlplus 命令行执行sql命令

主要是管道

echo -e "select sysdate from dual" | sqlplus username/password@ip:port/orcl

当使用groovy script时

def result=['/bin/bash', '-c', 'echo -e "select sysdate from dual" | sqlplus username/password@ip:port/orcl'].execute().text

你可能感兴趣的:(bash,sql)