开发者

Does SQL*Plus natively allow queries to run from the shell itself?

开发者 https://www.devze.com 2023-01-10 19:15 出处:网络
For example, is there equivalent of these in SQ开发者_如何学CL*Plus sqlplus \'SELECT * FROM emp\' | less

For example, is there equivalent of these in SQ开发者_如何学CL*Plus

sqlplus 'SELECT * FROM emp' | less 
sqlplus 'SELECT * FROM emp' | grep Primx

One way has been suggested by paxdiablo here. Is that the only way?


you can do it with here documents:

sqlplus  -S user/password << EOF | grep Primx
select * from emp;
EOF

-S is for silent mode, followed by username and password combination.

0

精彩评论

暂无评论...
验证码 换一张
取 消