Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sqlplus echoing script on opening

Posted on 2012-03-21
10
Medium Priority
?
411 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 21

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 21

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 21

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 78

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 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

886 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