empno=100ä¸åå¨çï¼æ¹ææçæ°æ®äºã
#!/bin/bash
result=$(sqlplus -s 'scott/tiger@dbname'<<EOF
spool test.txt
set pages 0
set feed off
set heading off;
set feedback off;
set verify off;
set linesize 1000;
SELECT * FROM scott.emp where empno=7369;
spool off
EOF
)
echo $result
~
~
~
~
~
~
~
~
~
"test.sh" 14L, 256C written
oracle@****:~> ./test.sh
7369 SMITH CLERK 7902 17-DEC-80 2240.06 20
oracle@****:~> more test.txt
7369 SMITH CLERK 7902 17-DEC-80 2240.06
20
追é®å¤å¶ç²è´´çä¸è¡å¦