Solved

sqlplus echoing script on opening

Posted on 2012-03-21
10
373 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
  • 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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 76

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 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now