SQL*Plus Editor related-How to..?
I have executed a query, which successfully returned a result.
But the result does not fit the editor (using SQL* Plus Editor) size, as the text_length of the result is approx 900 characters. I have altough tried increasing the Linesize, still the result is not fitting the editor.
I am a novice to SQL * PLUS..
Thank You in advance for your help.
Sairam
You need to change the buffer width. If you are using sqlplus for windows, then it is unde Options->Environment
If you are using sqlplus for command line, you need alter the layout of the command window.
Similar Messages
-
Connecting java to sql plus editor
I want to open oracle sql plus editor by giving user name and password from a java program and send queries from java program to the sql plus editor to execute.
I have the same sort of requirements, but I don't think that SQLPlus can be used that way. The requirements stem from having scripts written by Oracle developers that SQLPlus can parse, but are hard to parse into JDBC-executable statements with Java.
In my case I have several Oracle database developers who produce SQL scripts to e.g. create and change PL/SQL, change tables, add and remove data, etc. Generally all kinds of DDL and DML. They write one master script to execute the rest of the scripts for a particular change, using SQLPlus' @[filepath] notation.
I am somehow supposed to be responsible for releasing this stuff, which would normally mean executing each master script through SQLPlus.
I am trying to figure out a way to do this automatically.
SQLPlus would be good for this as it is written to parse the scripts that Oracle developers are used to writing.
The problem is that running SQLPlus from the command line only lets you run one (master) script, and doesn't let you set up named variables. So you can't run scripts generically; you have to know which variables turn up in which scripts, which makes it impossible to run in more than one environment/schema.
If I do things in JDBC, I have to either get the Oracle developers to write their scripts as Java strings - which would lead to a lot of errors - or try to parse the scripts in the same way that SQLPlus does - which would lead to a lot of errors.
I will look at getting the developers to delimit each statement with e.g. '----------------------' which I can use to break the scripts up into separately executable statements. I doubt this will make them happy.
I may also have to look at doing token replacement to set variables. -
Download Oracle SQL*Plus help related like word help
Hello all
I just wanna ask if where i can download Oracle SQL*Plus help related like word help.?
ty<p>You can access SQL*Plus help from the command line in a SQL*Plus session by typing 'help index'. If you want more information than that, take a look at the SQL*Plus Quick Reference located <b>here</b> or the SQL*Plus User's Guide and Reference located <b>here</b>. These docs are all for Oracle 10g. Other version documentation can be found <b>here</b>.</p>
Tom -
How do you create a complete database in notepad and execute it in SQL*Plus
I am new to Oracle / SQL*PLUS / and the SQL Language. I have never done anything with these products before. I am running Oracle 9i Enterprise Edition. I have a database created and I was able to get a table created.
That's it so far....
I would like to start doing all coding and editing in Windows Notepad and then execute the code from within the SQL*Plus editor.
Can someone please tell me......How do I do this???
I have my data, that I will be running queries on, located in a text file.
How do I get my SQL code to import the data from a text file into my tables???
Thanks,
Bobby HowertonActually, @your_text_file would start executing this textfile - which is ok if there is SQL code in the file. But how I understand the question, is that the data to load into one ore more tables is in the text file. Is that correct?
If so, if it's a lot of data, it's worth entering the documentation on the Server Utilities, search for SQL loader for example.
If it's only a view records, than simply alter the contents to something like:
insert into <put_table_name_here> (<put_column_names_here>) values (<data in the text file, seperated with comma's>);
And there should be one line like this for each record, or look up the command "insert all" in the SQL reference.
Good luck! -
Oracle10g - getting error when tried to log in using SQL plus
I have installed Oracle Database 10g with following settings
A) In Select Installation Method with basic installation
1) Global Database Name: orcl
2) Database Password: srinu
B) In Database Configuration Assistant shows following information
Global Database Name: orcl
System Identifier(SID):orcl
c) Password management
User Name SYS and SYSTEM shows accounts are not locked and password shows empty
I have tried to log in using scott/tiger, SYS/srinu, SYSTEM/srinu, SYS, SYSTEM with providing no pass word
Could you please provide me the details to connect Databse from SQL plus editor
I have all the screen shots of the above settings
I will appreciate any helpPlease find the commands and respective results below
D:\Documents and Settings\Administrator>SET
ALLUSERSPROFILE=D:\Documents and Settings\All Users
APPDATA=D:\Documents and Settings\Administrator\Application Data
CLIENTNAME=Console
CommonProgramFiles=D:\Program Files\Common Files
COMPUTERNAME=SRINU
ComSpec=D:\WINDOWS.0\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=D:
HOMEPATH=\Documents and Settings\Administrator
LOGONSERVER=\\SRINU
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=D:\oracle\product\10.2.0\db_2\bin;D:\WINDOWS.0\system32;D:\WINDOWS.0;D:\WIN
DOWS.0\System32\Wbem;D:\Program Files\Java\jdk1.5.0_19\bin;D:\Program Files\Apac
he Software Foundation\Tomcat 6.0\bin;D:\Program Files\Java\jre1.5.0_19\lib;D:\o
racle\product\10.2.0\db_2\BIN
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PERL5LIB=D:\oracle\product\10.2.0\db_2\perl\5.8.3\lib\MSWin32-x86;D:\oracle\prod
uct\10.2.0\db_2\perl\5.8.3\lib;D:\oracle\product\10.2.0\db_2\perl\5.8.3\lib\MSWi
n32-x86;D:\oracle\product\10.2.0\db_2\perl\site\5.8.3;D:\oracle\product\10.2.0\d
b_2\perl\site\5.8.3\lib;D:\oracle\product\10.2.0\db_2\sysman\admin\scripts;
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0d08
ProgramFiles=D:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=D:
SystemRoot=D:\WINDOWS.0
TEMP=D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
USERDOMAIN=SRINU
USERNAME=Administrator
USERPROFILE=D:\Documents and Settings\Administrator
windir=D:\WINDOWS.0
============================
D:\Documents and Settings\Administrator>lsnrctl status
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 16-MAY-2010 03:08
:55
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
ction
Start Date 15-MAY-2010 23:44:31
Uptime 0 days 3 hr. 24 min. 25 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File D:\oracle\product\10.2.0\db_2\network\admin\listener.o
ra
Listener Log File D:\oracle\product\10.2.0\db_2\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.51)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
========================================
D:\Documents and Settings\Administrator>lsnrctl service
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 16-MAY-2010 03:10
:10
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER <machine: SRINU, pid: 3740>
(ADDRESS=(PROTOCOL=tcp)(HOST=srinu)(PORT=1092))
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
Thanks,
Srinivas -
How do i get sql plus to start in something other than command prompt?
I have just installed oracle 11g enterprise addition. I am use to a different type of editor for the sql plus, the one I am use to comes up in a white area and has drop downs for file, tools, spool, help and so on. You can also open notepad with a shortcut. I like this better than command prompt how do i get this?
I think you mean sqlplusw.exe which is a Windows executable delivered until Oracle 10.2 but no more delivered with Oracle 11g.
Mayb you can have a look to SQL Developer http://www.oracle.com/technology/software/products/sql/index.html -
How do i access the SQL*plus
hello, i am having problems accessing my SQL*plus: its asking for a login name, password and some host string what is this? someone please help
thank you
A.I have only begun to learn database related fields. I have downloaded the iSQL*Plus (from this Oracle site), but am unable to use it due to complications in installing this product. How does one access the Oracle server? I trying to access it via my home PC (w/ windows98). Do I need to purchase additional software on my own? if so which one? How would any of you suggest I go about learning the PL/SQL (on my own as classes won't fit in schedule) ? Appreciate your help.
-
IF statement in SQL*Plus - how to do it
Hi,
In SQL*Plus script, I would like to keep conditional checking (IF statement) and proceed. For example, whatever is done in PL/SQL block below, want to do the same in SQL*Plus script, I know partly it can be done using VARIABLE keyword, conditional checking can be done using DECODE in SELECT statement, but I want to carry out a more complex requirement, hence I want to use IF statement somehow in SQL*Plus.
Another question, how to do spooling in PL/SQL script, it can be done using UTL_FILE, any other option is there to achieve this.
declare
v_ind_count int;
begin
select count(1) into v_ind_count from user_indexes where index_name = 'index_object_name';
IF v_ind_count > 0
THEN
dbms_output.put_line('index found');
ELSE
dbms_output.put_line('index does not exist');
END IF;
end;
/Hello,
SQL*PLUS has no scripting language. It can only execute SQL and PL/SQL scripts. There are some commands like SPOOL or SET but no commands for conditional statements. You should describe your requirements, maybe we can find a way.
Or you can search the forum, maybe your question has already been answered
[Google for SQL*PLUS + condition|https://www.google.de/search?q=site%3Aforums.oracle.com+"SQL*PLUS"+condition]
# {message:id=4189517}
# {message:id=4105290}
how to do spooling in PL/SQL scriptFrom within PL/SQL you can use dbms_output, the spool has to be started by the calling SQL script when it is executed in SQL*PLUS. Or you can use utl_file, but then you can only write to a server directory, not into a client file. To give an advice we need more information about what you want to do.
Regards
Marcus -
How to change the default directory from within SQL*Plus ?
Hello,
I want to change the default directory directly from within SQL*Plus to be able to launch my command files with simple instructions like :
@my_command.sql
If I haven't launched SQL*Plus from the directory containing the file my_command.sql, how do I change the default directory to the directory of my command files ?
I've searched through the Oracle documentation, there's no SET DEFAULTDIR or something like that. When I do a SHOW ALL, there's no variable containing the default directory.
If you have an idea...
regards,
Jérôme.Hi Jérôme (Jé²´me ?),
You cannot directly do that, but you can use @@ instead of @ to run subscripts in the same directory as the superscript
# head /tmp/tl30/xxx/[xyz].sql
==> /tmp/tl30/xxx/x.sql <==
prompt call y
@y
prompt call z
@@z
quit
==> /tmp/tl30/xxx/y.sql <==
prompt i am in y
==> /tmp/tl30/xxx/z.sql <==
prompt i am in z
# pwd
/root
# sqlplus -s scott/tiger@lsc62 @/tmp/tl30/xxx/x.sql
call y
SP2-0310: Datei "y.sql" konnte nicht geöffnet werden
call z
i am in zKind regards
Laurent Schneider
OCM DBA -
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 define variables in toad sql script editor - newbie
I have just pull out the script of a Function and want to run it on toad SQL editor.
I am little bit confused how to define the VARIABLEs here in toad SQL editor to run my script.
SELECT
NVL(SUM(debit), 0) - NVL(SUM(credit), 0)
INTO l_accountBalance
FROM
GLP_VoucherMaster vm
INNER JOIN GLP_VoucherDetail vd ON vm.GLP_VoucherMaster_ID = vd.GLP_VoucherMaster_ID
INNER JOIN GLP_ChartOFAccounts coa ON vd.GLP_ChartOfAccounts_ID = coa.GLP_ChartOfAccounts_ID
WHERE
vm.isActive = 'Y' AND vd.isActive = 'Y'
-- *** how to define variables in toad sql script editor ***
AND vm.voucherDate < p_cDate
AND coa.AccountCode LIKE p_accountCode || '%';
Thanks
w\Just prefix with a colon (:)
SELECT NVL (SUM (Debit), 0) - NVL (SUM (Credit), 0)
INTO L_accountbalance
FROM Glp_vouchermaster Vm
INNER JOIN
Glp_voucherdetail Vd
ON Vm.Glp_vouchermaster_id = Vd.Glp_vouchermaster_id
INNER JOIN
Glp_chartofaccounts Coa
ON Vd.Glp_chartofaccounts_id = Coa.Glp_chartofaccounts_id
WHERE Vm.Isactive = 'Y'
AND Vd.Isactive = 'Y'
AND Vm.Voucherdate < :P_cdate
AND Coa.Accountcode LIKE :P_accountcode || '%';
/:p -
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 -
How to pass table type variable into function from SQL*PLUS ?
How to pass a table type variable from sql*plus prompt into a function ?
Thanx in advance.Krishna,
Do you mean like this?SQL> DECLARE
2 TYPE t_tbl IS TABLE OF VARCHAR2(20);
3 l_sample_tbl t_tbl;
4
5 FUNCTION print_contents ( p_tbl IN t_tbl )
6 RETURN VARCHAR2
7 IS
8 l_string VARCHAR2(1000);
9 BEGIN
10 FOR i IN 1..p_tbl.COUNT LOOP
11 IF (i = 1) THEN
12 l_string := p_tbl(i);
13 ELSE
14 l_string := l_string || ', ' || p_tbl(i);
15 END IF;
16 END LOOP;
17 RETURN (l_string);
18 END print_contents;
19
20 BEGIN
21 l_sample_tbl := t_tbl();
22 l_sample_tbl.EXTEND;
23 l_sample_tbl(1) := 'one';
24 l_sample_tbl.EXTEND;
25 l_sample_tbl(2) := 'two';
26 l_sample_tbl.EXTEND;
27 l_sample_tbl(3) := 'three';
28 l_sample_tbl.EXTEND;
29 l_sample_tbl(4) := 'four';
30 l_sample_tbl.EXTEND;
31 l_sample_tbl(5) := 'five';
32 DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
33 END;
34 /
one, two, three, four, five
PL/SQL procedure successfully completed.
SQL> HTH,
T. -
HI,I came to know that direct exit from SQL Plus without Oracle shutdown causes future issues of ORA-0600 kind of errors. Is it true? If yes could u pls suggest me how to shutdown from user "SYSTEM/manager". Bcoz with this am warned that I dont have previleges.
Hello,
HI,I came to know that direct exit from SQL Plus without Oracle shutdown causes future issues of ORA-0600 kind of errors. Is it true?The ORA-00600 is an internal error it can be caused for instance by a Bug, a corruption, ... , and if someday you experience this kind of error, you should open a Service Request to My Oracle Support.
However, I've never heard that exiting sqlplus could cause this kind of error. Where did you get such information ?
how to shutdown from user "SYSTEM/manager". To shutdown the database you should be connected with the User SYS (as SYSDBA). You may use the following statement:
sqlplus /nolog
connect / as sysdba
shutdown immediate;
exitHope this help.
Best regards,
Jean-Valentin -
How to connect from sql*plus to Sql Server
Dear Profs.
How I can connect from sql*plus v8 on my local pc(Win XP) to Sql Server Express 2005 light weight installed in same local pc ?
Thanks,
Ahmed.You'll need to setup heterogeneous services. This is done by creating an init file for the SQL Server db with %ORACLE_HOME%\hs\admin that refers to a DSN for the Sql Server Database. The listener would also need an entry for the SQL Server DB DSN. After that you would create a dblink to SQL Server in your Oracle instance and then could query across the dblink.
Maybe you are looking for
-
MSI Neo2-P network cable unplugged
Hello I am new here and do not come even close to posessing the levels of knowledge I havbe read in some posts. That said I have an issue that I found some threads slightly relevant to but not entierly.\ I have a MSI Neo2-P with the realtek network
-
Opening dbs thru button events, help, i`m a newbie..
i have the following fn for opening the db public static void main(String args[]) throws Exception new login(new javax.swing.JFrame(), true).show(); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); open(); select(); static void open() throws SQLExcepti
-
Problem passing an export parameters in rfc call using the function control
Hello, I use SAP Remoute Function Control (wdtfuncs.ocx) in my C++ application. I can execute remote functions, if they don´t need any export parameters: CSAPFunctions m_Functions; CFunction f; f.m_lpDispatch = m_Functions.Add("RFC_CREATE_DOCUMENT_MA
-
Execution of Perl Script from HTML DB page.
Hi All, I have a Perl script which takes 5 parameters and fetches data from one database and insert that data into my database table which is a master table for my project. Is there any way to execute the perl script from a HTMLDB page by passing par
-
Getting the error "Authentication failed."
Hi, I am getting the error +"Authentication failed. If problem persists, please contact the system administrator"+ while login to OEM12c grid console as sysman user. I thought it was sysman password related and set the new password at DB level and OM