How to cancel a search in SQL*Plus
Once a search is initiated in SQL*Plus Worksheet, how can you stop it? I am on Windows NT. The normal Ctrl-C, Ctrl-Break, Esc don't work. I found an obscure reference in the SQL*Plus documentation about a cancel function, but it didn't give the keystrokes.
I actually managed to crash an 8.0.5 database by hitting Ctrl-C in the middle of a query.
Oracle Support advised me that this was a known bug. The solution?
Don't hit Ctrl-C in the middle of a query!
null
Similar Messages
-
How to retreive this file in SQL*Plus
If I upload files which name is KOREAN, name of files is invisible.
I dont't know cause of this problem.
How is keeping korean name of file from breaking?
Also, answer how to retreive this file in SQL*Plus
Thanks
silverbellTo access ifs data from SQL, you need to (officially) setup a 'user view'. Refer to the Java API documentation on how to do this. Once you have created the user view, then you may access this view using any SQL tool.
-
How to Generate Trace Files in SQL*Plus
Hi Friends ,
How to Generate Trace Files in SQL*Plus ?
i have no idea
thanks
rajWhat trace files would you like to generate?
Are we talking SQL trace files?
ALTER SESSION SET sql_trace = TRUE;This will be generated in the user_dump_dest on the server.
show parameter dump -
How to find session information in sql plus
Can someone please tell me how to find session information in sql plus? I specifically want to know my privileges for the current session. Thanks in advance.
SELECT * FROM session_privs;
SELECT * FROM session_roles; -
How to invoke multiple sessions of sql*plus thru pl/sql program
Hi
How to invoke multiple sessions of sql*plus thru pl/sql program.
ThanksHow to invoke sql*plus in a procedure?????
I have to invoke more pl/sql sessions?????No you don't "have to".
Look at what you are trying to do.
You have a program running inside the PL/SQL engine. This is running nicely inside the Oracle database and is perfectly capable of issuing other SQL statements, PL/SQL programs etc. inside it's nice cosy Oracle environment.
You are asking for this PL/SQL to shell out to the operating system, run an external application, for which it will have to supply a username and password (are you planning on hard coding those into your PL/SQL?), and then that external application is supposed to run more SQL or PL/SQL against the database.
a) Why hold all this code external to the database when it can quite happily reside on the database itself and be executed through jobs or whatever.
b) Consider what would happen if someone were to replace the external application with their own program of the same file name... they'd be able to capture the username and password for connecting to the database, therefore a major security flaw.
The whole idea of doing what you want through external calls to SQL*Plus is ridiculous. -
How to get Arabic dates in SQL*Plus?
I want to do a very simple thing.
I want to type in Arabic and Display dates in Arabic.
Instead i get ????? ??????? ????? ??????? ? ? ???????, ????? for this?
Why is this?
I then changed my Windows XP "Regional and Language Options" all to Arabic. Now, I get AR (Arabic) in my language selection bar at the bottom of the Desktop. When I choose AR I can type Arabic in Notepad. ُ
Even HERE I can type in Arabic: فغحث غخعق ةثسسشلث اثقث
But in Sql*PLus I get ????? ??????? ????? ??????? ? ? ???????, ?????
If I choose AR in SQL Plus and type in Arabic I get garbage characters?
How to get Arabic in Sql*Plus?
SQL> SHOW USER
USER is "ARABDTEST"
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL> SELECT * FROM nls_session_parameters;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
17 rows selected.
SQL> ALTER SESSION set NLS_DATE_LANGUAGE = 'ARABIC';
Session altered.
SQL> SELECT TO_CHAR(SYSDATE, 'RRRR/MM/DD YEAR MONTH DAY MON DY AM PM DL') FROM dual;
TO_CHAR(SYSDATE,'RRRR/MM/DDYEARMONTHDAYMONDYAMPMDL')
2013/04/08 TWENTY THIRTEEN ????? ??????? ????? ??????? ? ? ???????, ????? 08, 2013
SQL> ALTER SESSION set NLS_DATE_LANGUAGE = 'AMERICAN';
Session altered.
SQL> SELECT TO_CHAR(SYSDATE, 'RRRR/MM/DD YEAR MONTH DAY MON DY AM PM DL') FROM dual;
TO_CHAR(SYSDATE,'RRRR/MM/DDYEARMONTHDAYMONDYAMPMDL')
2013/04/08 TWENTY THIRTEEN APRIL MONDAY APR MON PM PM Monday, April 08, 2013
SQL> SELECT * FROM nls_database_parameters;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET WE8MSWIN1252
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.1.0.6.0
20 rows selected.I am not sure SQL*Plus in character mode can display Arabic characters on Windows. OTN NLS_LANG FAQ http://www.oracle.com/technetwork/products/globalization/nls-lang-099431.html#_Toc105389288 says:
>
if you are testing with "special" characters please DO use the GUI and not the "DOS box" sqlplus.exe !
>
SQL*Plus GUI is not available with 11G: you should use SQL Developer. -
How to run multiple scripts in sql*plus?
I would like to run 2 scripts in sql*plus, how do I do this? I tried the following, but it won't run.
create table student_new
AS
select *
from student
insert into student_new
(last_name, first_name
values
(Crop, Jenny)
The above are the two scripts I want to run, what am I doing wrong.
ThanksDo you have a solution to run multiple scripts continuosly, one after the other as one script.
Say I have file1.sql file2.sql, file3.sql.
I want to create a script run.sql, where this will run file1.sql,file2.sql,file3.sql one after other without any one running one after the other like follows:
run.sql should have
begin
@file1.sql
@file2.sql
@file3.sql
dbms_output.put_line(select sysdate from dual);
end;
If I run run.sql all the three scripts should be executed successfully and then display the current time . All these files have update statements(50,000 updates each file).
Very urgetn. Can some one hlpe, please.
Thanks in advance. -
How execute this stored procedure from SQL PLUS???
Hello folks....
Help me please...
I have this procedure....
CREATE OR REPLACE PROCEDURE TEST(COD OUT VARCHAR2, NUM OUT
VARCHAR2, ID OUT VARCHAR2)
AS
BEGIN
END;
SO, I4D LIKE TO EXECUTE IT FROM SQL PLUS::
BUT, I DONT KNOW HOW TO DO..PLEASE SEND ME A SAMPLE..
THANK UThank u man!!!
look, my error before was :
SQL> set serveroutput on
SQL> declare
SQL> cod varchar2(100);
SQL> num varchar2(100);
SQL> id varchar2(100);
SQL> begin
SQL> TEST( cod, num, id );
SQL> EXEC DBMS_OUTPUT.put_line( cod || ' ' || num || ' ' ||
id );
SQL> end;
SQL> /
i put the EXEC....
thank u!!! -
How to bind DATE variables in SQL*Plus
I have a stored procedure in a package that has a DATE OUT parameter
myPackage.myProcedure( outDate OUT DATE )
I am trying to test this from SQL*Plus
How do I specify a Bind variable for the outDate? The VARIABLE command does not allow DATE types?
If this was a CHAR type I could have done
VARIABLE myChar CHAR
BEGIN
myPackage.myProcedure( :myChar )
END;
PRINT myChar
How do I do this with DATE data types instead? I am using Oracle 8.1.7.you should use VARCHR2 type with the minimum length that can store a value defined by your NLS_DATE_FORMAT
string. The returned date will be converted to a VARCAHR2 type and the size and format will depend on
your NLS_DATE_FORMAT setting.
=============================================================================
SQL> variable dt VARCHAR2(20)
SQL> create or replace procedure ret_date(dt OUT DATE) is
2 begin
3 dt := SYSDATE ;
4 end ;
5 /
Procedure created.
SQL> exec ret_date(:dt) ;
PL/SQL procedure successfully completed.
SQL> print dt
DT
13-OCT-02
SQL> select sysdate from dual ;
SYSDATE
13-OCT-02
SQL> alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS' ;
Session altered.
SQL> exec ret_date(:dt) ;
PL/SQL procedure successfully completed.
SQL> print dt
DT
13-OCT-2002 10:43:23
SQL>
================================================================ -
How to Hide password when invoking sql plus from command promt?
When i try to open sql plus in command prompt window and enter the sqlplus command follwed by username/password@connection string, the password is not hidden.
How do I get it to show **** instead of displaying password characters out?
Also, what is the command to clear screen : when I try cls or clear screen, I get a windows memory exception of somekind and the only option there is to kill the command window.
Any tips on getting around this?
Thanks a lot for your time and help.user8848256 wrote:
Can you please give more details on how to not enter password when calling sqlplus from command window like you are saying?
I tried this :
sqlplus username/ @connection string -->Hit Enter : it asks for password but does not recognise the connectionstring to connect to.
sqlplus username/ -->Hit Enter: It does same thing again.asks for password but gives tns adapter error after the password is entered.Leave out the slash:
sqlplus username@connect_string -
How to compile a procedure from Sql*Plus?
Dear friends,
I couldnt find the way how to compile my invalid procedure through sql*Plus.
I know this is very awkward,but I m in need of that command only.
Thanks
Ritesh SharmaPls check it --
SQL>
SQL>
SQL> @C:\RND\Oracle\Function\a.sql;
11 /
Function created.
SQL>
SQL>
SQL> start C:\RND\Oracle\Function\a.sql;
11 /
Function created.
SQL> Regards.
Satyaki De. -
How to return a value from sql plus activity
Hi,
I want to return a value from sqlplus activity to a processflow variable.
SQL PLUS activity has a property :"RESULT_CODE", whenever i run the process flow this value is always reurned as 0.
in sqlplus activity i have written some pl/sql block....
for example
begin
end;
exit
i want to do something like
begin
if v=100 then
return 1
else
return 0;
end if;
end;
exit
can some please tell me how can i return value from this pl/sql block to proessflow.
Regards,
RD_RBStable ==> function
input param from table to function. ==> input mapping paramter to store the output from the mapping.
Will this now work. -
How to control logic flow in SQL Plus script
Hi
I have the requirement below:
Before I start running an SQL script, I need to ensure that I am connecting as a particular user. If I am not that user, then the script should show a msg "Error - Invalid User - Log in as <<username>>"
Let's say i am executing a script A.sql.
SQL > @<path>a.sql
But before this script is executed -- i shall check for the user:
block begins...
select user into var1 from dual
if upper(var1) != 'ABCUSER' then
-- display the error message and stop execution of this script
else
@<path>a.sql (*it executes what i want :) )
end if;
block ends...
How do I write this code using an SQL script ? Pls suggesHi,
As Centinul said, SQL*Plus is poorly equipped to deal with problems like this. If possible, try to do what you want outside of SQL*Plus.
If you really have to do it in SQL*Plus, here are two ideas:
(1) run a script conditionally
(2) deliberately raise an error
(1) Using SQL*Plus substitution variables, you can decide which of several scripts to run as a sub-script, based on the results of some query.
For example, if a.sql is the script that only user ABCUSER is allowed to run, then write two other very short scripts:
(a) warning.sql, such as the following:
-- warning.sql
PROMPT You are not authorized to do this.
QUIT(b) step_1.sql, which decides whether a.sql or warning.sql should be run, and does it:
-- step_1.sql - Decide whether a.sql or warning.sql is to be run next, and do it.
-- (a) decide:
COLUMN script_name_col NEW_VALUE script_name
SELECT CASE
WHEN USER = 'ABCUSER'
THEN 'a.sql'
ELSE 'warning.sql'
END AS script_name_col
FROM dual;
-- do:
@&script_nameYou may want to use @@, or specify a complete path name.
(2) Deliberately raise an error, either in a separate script or in a.sql itself, like this:
WHENEVER SQLERROR EXIT
SELECT CASE
WHEN USER = 'ABCUSER'
THEN NULL
ELSE TO_NUMBER ('This will raise ORA-01722')
END AS "Welcome!"
FROM dual;
WHENEVER SQLERROR NONE
-- continue with the original a.sql -
There are 2 buttons on a JSP page: One is called Search, another is called Cancel.
When the Search button is pressed, it will trigger an AJAX call, this ajax will call a Java function, while this java function makes a function call to the Oracle database (store procedure/function).
This searching process will take a while... At the mean time, the user wants to cancel the searching. So the user pressed the Cancel button.
Here, I want this cancel process to do two things: 1) to cancel the call to Oracle database; 2) to cancel the Ajax process;
How can I do that?
Thanks
Scott1) you can't. Once Oracle is doing its thing it's doing its thing and won't listen to reason.
2) has nothing to do with Java. Set some flag on the client that tells Ajax to ignore the results (there should be something like that, I'd put it in).
So now your search is still being executed (until it times out of course) but the results are ignored.
You might be able to send a message to the application server telling it to not bother to send the result, and depending on how you coded the database code this might be useful to prevent all but the currently executing queries.
How you do that is up to you... -
How to detect client OS from SQL*Plus script
Sometimes in a SQL*Plus script I need to execute OS commands e.g.
host rm tempfile.bufHowever of course Windows has no "rm" command by default, so I have to edit the script to use
host del tempfile.bufNow if I could define &DELETE (for example, "cat"/"type" is another) as a substitution variable, I could just use
host &DELETE tempfile.bufMaybe I need more coffee but all I could come up with was something like this:
def rm=rm
def cat=cat
spool sqlplus_windows_defs.cmd
prompt echo def rm=del
prompt echo def cat=type
spool off
host .\sqlplus_windows_defs > sqlplus_windows_defs.sql
@sqlplus_windows_defs.sql
host &rm sqlplus_windows_defs.cmd
host &rm sqlplus_windows_defs.sqlthe idea being that you first define the variables for nix ("rm" and "cat"), then attempt to create and execute a Windows command file containing DOS versions ("dele" and "type"), which does not run under nix. Unfortunately the OS failure message (".sqlplus_windows_defs: not found" in Unix) appears on the screen despite SET TERM OFF, so I'm back where I started.
I know there are various ways to get the server OS, and you can get the SQL*Plus version with &_SQLPLUS_RELEASE and so on, but I can't see a way to determine the client OS. Any suggestions?Thanks guys. This seems to work in Windows XP - will try on Unix when I get a chance:
col DELETE_COMMAND new_value DELETE_COMMAND
col LIST_COMMAND new_value LIST_COMMAND
def list_command = TYPE
def delete_command = DEL
SELECT DECODE(os,'MSWIN','TYPE','cat') AS list_command
, DECODE(os,'MSWIN','DEL','rm') AS delete_command
FROM ( SELECT CASE WHEN UPPER(program) LIKE '%.EXE' THEN 'MSWIN' END AS os
FROM v$session
WHERE audsid = SYS_CONTEXT('userenv','sessionid') );
host &LIST_COMMAND xplan_errors.lst
host &DELETE_COMMAND xplan_errors.lstIf the user doesn't have access to v$session it will just default to the Windows commands.
http://www.williamrobertson.net/code/xplan.sql
Maybe you are looking for
-
What to do with my G3 Blue and White
Alright, this is my first post, so bare with me. Recently I have purchased a used Powermac G3, B&W 350MHZ computer. Within it, it contains a 6gb hard drive, and 256 MB Ram. I have never owned a mac before and I am very limited on my knowledge of them
-
Creation Date of MM Master Data
Hello All, I would like to know what r the master datas of MM has been created in the month. ( From - to ) is ther any T. code from which i could get these reports. Thanks in adavace
-
Help with removing bordered looking lines
So in this picture around the object on the right looks like it has a greyish/white line and I dont know where it came from or how to get rid of it please help
-
Error generating report - Program was terminated by signal 11
Hi All, I am very new to XML Publisher reports and I am facing the following issue in a report - Program was terminated by signal 11 I created the data model in RDF and for this I created the corresponding RTF file. When I see the preview of this RTF
-
I have a JList which show different attributes values of a item in a line. I am trying to align each of the attributes to follow in the same vertical alignment. To do so, I used "\t" but I am facing some problem, is that as the length of the attribut