Solved

sqlplus echoing script on opening

Posted on 2012-03-21
10
400 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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…
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.  …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
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.
Suggested Courses

617 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