Home » Other » Client Tools » disabling sqlplus output
disabling sqlplus output [message #257083] Tue, 07 August 2007 10:03 Go to next message
mrsmithq
Messages: 2
Registered: August 2007
Junior Member
I have this sql script that is called via sqlplus. It inserts data into a table from another table. The problem is that when it does the select from the table to retrieve the data, it actually shows the data. I don't want it to do that. That creates a huge log file. I have another script that does the same thing but it does not produce the output. How do I avoid seeing the result set from the select?

Here is my sqlfile:


TRUNCATE TABLE mytable;

INSERT INTO mytable(
coulmn1,
column2,
column3,
column4)

SELECT coulmn1,
an_oracle_function(a, b, c) as column2,
column3,
column4
FROM (
SELECT
a,
b
c)res,
another table
WHERE column3 > 100;

commit;
exit;
Re: disabling sqlplus output [message #257092 is a reply to message #257083] Tue, 07 August 2007 10:17 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
If it was written correctly, you wouldn't see any data. I suspect it is not written correctly: the blank line between the insert statement and the select means the INSERT part is being ignored. It goes into the SQL*Plus buffer but then gets overwritten by the select statement. The select statement then gets executed and you see the output.

[Updated on: Tue, 07 August 2007 10:20]

Report message to a moderator

Re: disabling sqlplus output [message #257106 is a reply to message #257083] Tue, 07 August 2007 10:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).

Regards
Michel
Re: disabling sqlplus output [message #257154 is a reply to message #257106] Tue, 07 August 2007 11:59 Go to previous messageGo to next message
groesbeek
Messages: 9
Registered: August 2007
Location: Netherlands
Junior Member
>.The problem is that when it does the select from the table to retrieve the data, it actually shows the data

Issn't that something like
"set termout off" ??
Re: disabling sqlplus output [message #257156 is a reply to message #257083] Tue, 07 August 2007 12:04 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I have another script that does the same thing but it does not produce the output.
So make this script contain same controls as succeeds for working script.
Re: disabling sqlplus output [message #257180 is a reply to message #257156] Tue, 07 August 2007 13:03 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
if your function prints output and the have sqlplus "serveroutput" on, then you'll get output. If you are seeing output from dbms_output and the select exceeds the buffer size, your seatement will fail. Try to understand where the output is coming from rather than trying to suppress the downstream effects with arbitrary settings.
Previous Topic: Can I show milliseconds in TOAD ?
Next Topic: SQL +
Goto Forum:
  


Current Time: Thu Mar 28 11:01:34 CDT 2024