![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I'm working with Oracle 10.2.0.4.0 I have an unix script that via command line executes a query $ORACLE_HOME/bin/sqlplus -silent <<EOF * * * * connect user/pass@databse * * * * set pagesize 0 * * * * set heading off * * * * set echo off * * * * set term off * * * * set feedback off * * * * set linesize 126 * * * * spool /tmp/file_to_send * * * * SELECT * FROM table; EOF The issue is that if there is not data it generates a file with a control caracter (Don't know which one). I want to know how to avoid file generation via SQLPLUS commands or at least don't send any invisible caracter to the file. Thanks. |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Thanks David I actually did the corrections. *But i need the file zero lenght when there is no data to spool. Do you know a way to do that. Be generate a zero-lenght file or not generated it at all. Thanks. |
|
then echo "yes" else echo "no" fi no |
|
then echo "yes" else echo "no" fi yes |
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Thanks Joel, Actually it is very usefull. I'll try to implement it. The only inconvinient is that i'm migrating a lot of scripts that worked fine (generated zero-lenght files when no data found). So i'll still need the trick for Oracle. Thanks. |
#9
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |