views:

28

answers:

1

For example, is there equivalent of these in SQL*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?

+1  A: 

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.

ozk
@ozk: it works! what is here documents? How does this work?
Amoeba
I'm happy it helped :)here documents give you the ability to "feed" input into an interactive program. you can read more about it here:http://tldp.org/LDP/abs/html/here-docs.html
ozk