Solved

sqlplus echoing script on opening

Posted on 2012-03-21
10
383 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
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: 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 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.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

809 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