Solved

sqlplus echoing script on opening

Posted on 2012-03-21
10
393 Views
Last Modified: 2012-05-10
Hi experts,

This is probably a simple question but i can't find the trick. Whenever i open a script in sqlplus (windows version) the complete contents of the file are echoed to the screen. This is a nuisance because we work with very large generated scripts. I know this behaviour can be switched off but i can't find the right variable to do so. Any tips?

Thanks, Gertjan
0
Comment
Question by:keeskeeskees
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 20

Expert Comment

by:flow01
ID: 37746144
a) code
set echo off
at the beginning of your script
(and on if you want to set back the original setting)
b) code
set echo off
in de login.sql or glogin.sql that is executed by sqlplus each time its started (or at connect in later versions) if you want to change the default
0
 
LVL 6

Expert Comment

by:NikolasG
ID: 37746184
Hello,
Have you tried the  -s  trigger
sqlplus -s ..
This should do the trick for you.
0
 

Author Comment

by:keeskeeskees
ID: 37746206
Hi Flow,

I know the echo setting, but echo is for determining if commands are echoed when they are run. What i'm trying to prevent is that sqlplus echos script contents on loading (not executing) the script. If i select a script file in sqlplus with the file dialog sqlplus echo's the file contents to screen. The script is not run though, to do that i still need to type @<scriptname> at the prompt. I use the file dialog only to set the default directory.

Gertjan
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 20

Expert Comment

by:flow01
ID: 37746228
get filename  nolist
0
 

Author Comment

by:keeskeeskees
ID: 37746374
ok, so i guess sqlplusw does a get on opening the file in the file dialog. How can i make it default to the nolist option instead of the list option?

Gertjan
0
 
LVL 20

Expert Comment

by:flow01
ID: 37746834
I don't know.

I tried an alternative

In windows 7 I linked the .sql  extension to sqlplusw

In the registry I added the edit_nolist options

An export of the keys looks know like

[HKEY_CLASSES_ROOT\Applications\sqlplusw.exe]

[HKEY_CLASSES_ROOT\Applications\sqlplusw.exe\shell]

[HKEY_CLASSES_ROOT\Applications\sqlplusw.exe\shell\edit_nolist]

[HKEY_CLASSES_ROOT\Applications\sqlplusw.exe\shell\edit_nolist\command]
@="\"C:\\DevSuiteHome_1\\BIN\\sqlplusw.exe\" \"/NOLOG\" \"@C:\\DevSuiteHome_1\\BIN\\get_nolist.sql\" \"%1\" "

[HKEY_CLASSES_ROOT\Applications\sqlplusw.exe\shell\open]

[HKEY_CLASSES_ROOT\Applications\sqlplusw.exe\shell\open\command]
@="\"C:\\DevSuiteHome_1\\BIN\\sqlplusw.exe\" \"%1\""

the get_nolist.sql script looks like
get &1 nolist

Result : right mouse click on a sql-file gives a edit_nolist option
When clicking sqlplusw starts without logon and the sql-file is in edit memory without echo
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37746872
I've used sqlplusw for as many years as it has been out and never used File/Open from the menus.  Maybe it comes from many years of sqlplus command line.

Any reason you just don't use '@' to execute the scripts?  I typically have one window open with my script in some editor and sqlplus open.  I edit the script, move over to sqlplus and @ the script.

FYI: sqlplusw goes away with 11g.  It is no more.  Better get used to sqlplus command line anyway.
0
 

Author Comment

by:keeskeeskees
ID: 37747119
Hi Slightwv,

I use @ to execute the command. I only use the file dialog to set the default directory, but for that i need tot 'get' the file. I'ts not ideal but on a previous system the echoing did not happen, so i figured it must be some setting. I found that sqlplusw also works on 11g, it's just not in the distribution.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 37747267
>>I found that sqlplusw also works on 11g, it's just not in the distribution

Works yes, but requires you keep 10g installed.

>>to set the default directory

I have all my sql scripts in a common location.  I just set the 'Start in' in the Properties for the icon.
0
 

Author Closing Comment

by:keeskeeskees
ID: 37950743
The issue is not really solved but I gave up and have to close the question to ask another question
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
join actual table rows based on the column 25 44
UTL_FILE invalid file operation 5 60
Oracle performance tuning 2 58
Check for any ASM patches and install them. 1 25
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question