TermOut setting in Command Windows bug???

Stew Stryker

Member³
Hi,

I'm still just trying out Developer, so I might have a setting wrong.

It seems that the Command Window TermOut setting doesn't completely turn off output?

Check out this session of mine:


Code:
Connected to Oracle9i Enterprise Edition Release 9.2.0.5.0
Connected as stew

SQL> set echo off
SQL> set termout off
SQL> select count(*) from appeals;

  COUNT(*)
----------
    622027

SQL>
Shouldn't "set termout off" prevent the Command Window from displaying the results of my SELECT?

I wouldn't care all that much, but I tried running the script we have to allow us to jump between schemas, and it displayed the schema password!

Not good.

There's a "set termout off" in the script which normally blocks this display when run from SQL*plus. But it's totally visible in the Developer Command Window!

:eek:

Stew
 
Hi,

According to the SQLPlus documentation :

Code:
TERM[OUT] {OFF|ON}
   OFF suppresses the display of output from a command file    ON displays the output.
   TERMOUT OFF does not affect the output from commands entered interactively.
The command window too works exactly like this.
 
Thanks for the reply, and you're absolutely right.

I should have been clearer about my real concern and need.

As I mentioned, I first noticed this issue when I ran a script (aka a command file). It's one our DBAs use to let us jump between schemas, and my real problem is that the command window doesn't respect the SET TERMOUT OFF w/in the command file. So it's showing the password for the schema I'm jumping to.

Maybe the problem is more about SQL*plus suppressing output because of a SET TERMOUT OFF within a command file when it shouldn't? So their documentation doesnt' reflect how they implemented SQL*plus.

All I know is, Developer's command window acts differently than SQL*plus in this instance.

I can be trusted not to spread the password around, and I'm sure the other developers in the department are trustworthy too. But I can't recommend other developers here do a jump from PL/SQL Developer's command window with this behavior.

Thanks,

Stew
 
Could you give an example of such a command file?

Maybe I still don't understand, but if I run following command file:

Code:
set termout off
conn userX/passX@dbX
set termout on
select * from tableX;
I get the expected result in PL/SQL Developer's command window v6.0.2 (as in SQLPlus): only the output of the select statement is displayed, nothing from the "conn...".
 
That's the thing, the SELECT statement output is being displayed. As I said, I guess it's an issue w/ SQL*plus not following its own documentation.

When I run the following in SQL*plus, it doesn't display the SELECT results (which is the password). When I run it in Developer, it displays the password as a result of the SELECT and then prompts me for the password!

Code:
prompt New Jump
set echo off
set feedback off
set verify off
SET SERVEROUTPUT ON SIZE 100000
define schema='&1'
column paswrd new_value paswrd
column db_prompt new_value db_prompt
variable paswrd varchar2(30)
execute our_sys.jump.get_password('&schema', :paswrd);
set termout off
select :paswrd paswrd, name db_prompt FROM v$database;
connect &schema/&paswrd@&db_prompt
execute our_sys.jump.remove_instance;
undefine 1
set termout on
set feedback on
set verify on
show user
SET HEADING OFF FEEDBACK OFF
COLUMN db_name NEW_VALUE the_db
SELECT SYS_CONTEXT('USERENV', 'DB_NAME') AS db_name FROM DUAL;
set sqlprompt "&the_db..&schema> "
set echo off heading on feedback on
Output looks like this:

Code:
paswrd
---------
OuR_pAsSwOrD931
Now, maybe I can't do this sort of jump from w/in Developer, so this is all moot. I just thought I'd try it since they offer a Command Line interface.

Thanks for following this thread.

Stew
 
This is not a matter of termout. The output is not from the select statement. Then it should display two columns as you also selects the database name. The output is from an autoprint feature for the variable in the execute command as the following shows:

Code:
SQL> var a varchar2(10);
SQL> exec :a:='a';

PL/SQL procedure successfully completed
a
---------
a

SQL> set autoprint off
SQL> exec :a:='a';

PL/SQL procedure successfully completed

SQL>
SQL*Plus has autoprint off as default while the command window in PL/SQL Developer has autoprint on as default. I think it should be sufficient to turn it off.

By way, for me it is a real nice feauture to have autoprint on as default in the command window. Then I don't have to manually print them afterwards as I often did in SQL*Plus.

Hope it helps.

Bo Pedersen
 
Bo,

Thanks for the tip!

My apologies for suggesting this was a bug. I guess we should add SET AUTOPRINT OFF to this script, to be safe.
 
Back
Top