SQL * PLUS - setting wrap on for column
hi all, i am playing around with sql plus and i encountered the following problem.
1) is length 10 the default column length for columns with number datatype in sqlplus, i done a select statement and all my column for number have a length of 10
2) why cant i format the length of a number column. i type column empno format 999
although my numbers become #### but "empno" and a length of 10 is still shown at the column name instead of just "emp"
3) how come a column name canot be wrapped
when i set wrap on.
set wrap on
column ename format a3
only the values of ename are wrap
but the column name "ename" isnt wrap
into ena
me
thanks.
Some examples :
TEST@db102 > select 1234567890123 from dual;
1234567890123
1.2346E+12
TEST@db102 > set numwidth 15
TEST@db102 > /
1234567890123
1234567890123
TEST@db102 > col ename for a3 wrapped
TEST@db102 > select ename from emp where empno=7902;
ENA
FOR
D
TEST@db102 > You can find everything in the documentation
Similar Messages
-
Preference equivalents for relevant SQL*Plus set commands?
I know that the SQL*Plus set command is not supported in Raptor (as per http://www.oracle.com/technology/products/database/project_raptor/sql_worksheet_commands.html), but there are a number of set options that are relevant.
For example, set define (for which "set define off" is covered in Ampersand in scripts We have a number of existing SQL scripts where we have set the define character to something apart from & to avoid issues where this is a required value in the code.
Setting server output size is another option - as per set serveroutput on size unlimited .
Is there any proactive plan to provide preferences equivalent to the set options that are relevant (to either SQL scripts or the various output tabs)? Or is the exclusion of the SQL*Plus set command only for the current version and it will be included later? From the discussion on the forums so far, it seems as though you are looking at each set option as it is raised, rather than being proactive about it.
Even if Raptor does provide preferences, it would still be useful for the equivalent set commands to work. Lets say that we do get a preference for the define character - 99% of the time, scripts want this to be & - however there are some where the script wants it to be $ (or whatever). With a preference, I need to know what the script wants and change the preference before running the script and then change it back afterwards.Hi Turloch,
When is this script executed ?
In 3.1EA2 I created a sql script where a variable is defined and set this script as you suggested.
Script:
define varname=abc
When I open a connection, a worksheet is automatically opened. I run this statements:
select '&varname' from dual;
define varname=xyz
select '&varname' from dual;
Running the first select statement results in a popup window for entering a value for the substitution variable, while I was expecting the value abc as the result of the query.
See also this blog where the login script is explained.
But in my SQL Developer 3.1EA2 64-bit on Windows 7 it doesn't work like that.
Is this a bug?
Dennis -
W'azup with SQL Developer barfing on SQL*Plus "set" commands
Check out this short script and the results it generates, as pasted below.
I can't find anything in the SQL Dev documenation re: what SQL*Plus set commands it supports and which it considers "passe." I'm particularly puzzled by the "column ... format ..." command getting ignored.
set heading off
set pagesize 0
set linesize 80
set feedback off
prompt ...start...
column x format a5
select 'abcdefghij' x from dual;
prompt ...end...
line 1: SQLPLUS Command Skipped: set heading off
line 2: SQLPLUS Command Skipped: set pagesize 0
line 3: SQLPLUS Command Skipped: set linesize 80
...start...
X ----------
abcdefghij 1 rows selected
...end...For supported SQL*Plus commands: SQL Developer Help > SQL Developer Concepts and Usage > Using the SQL Worksheet > SQL*Plus Statements Supported and Not Supported in SQL Worksheet.
The "column ... format ...." command is not supported. A workaround is to use substr in your select statement.
See also How to set a column size in sqldeveloper? -
SQL*Plus variable assignment works for 8i but not 9i
We have scripts that connect to each database on the box and perform database tasks nightly. The scripts first set the environment then connects to each database with SQL*Plus. This works for 8i but fails in the recently created 9i environment. (Unix Solaris environment)
Because the SQL*Plus connection appears in many areas in the scripts, we assign the following connection string to a variable:
SQLPLUS="/usr/oracle/product/9.2.0/bin/sqlplus -s 'xxx/xxxxxx@xxxx as sysdba'"
Export SQLPLUS
echo "$SQLPLUS"
(This echo out correctly: /usr/oracle/product/9.2.0/bin/sqlplus -s 'xxx/xxxxxx@xxxx as sysdba')
It fails when the script calls the assigned variable:
$SQLPLUS <<-EOF
with the following error:
Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
<logon> ::= <username>[<password>][@<connect_string>] | / | /NOLOG
<start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
"-H" displays the SQL*Plus version banner and usage syntax
"-V" displays the SQL*Plus version banner
"-L" attempts log on just once
"-M <o>" uses HTML markup options <o>
"-R <n>" uses restricted mode <n>
"-S" uses silent mode
However, if I remove the SQLPLUS variable assignment and changed all occurrence of
$SQLPLUS <<-EOF to
/usr/oracle/product/9.2.0/bin/sqlplus -s 'xxx/xxxxxx@xxxx as sysdba' <<-EOF
Then the script runs successfully. But this solution is cumbersome.
Any ideas as to how to have the script work with assigning the SQLPLUS variable????
Any help is appreciated.I has an immediate suspicion it might be related to the issue
mentioned in
http://otn.oracle.com/support/tech/sql_plus/htdocs/sub_var2.html#2_7
but this proved wrong: the SP2-306 still occurs in the latest
SQL*Plus.
I wonder what version of 8i you had working? With an old SQL*Plus
8.1.7.0 my connection failed the same as in 9.2 and 10i.
My solution was to do:
SQLPLUS='sqlplus -s'
UNPW='/ as sysdba'
$SQLPLUS "$UNPW" <<EOF
EOFThis worked in 9.2.0.5, 10.1.0.2 and 8.1.7.0.
One common security risk on UNIX remains: putting the username and
password on the command line. On some systems a "ps" command will
show the password to any user. If OS authentication cannot be used
for connection, perhaps putting the username/password in the SQL
script may be more secure?
A final note is that in SQL*Plus 10g, no quotes are needed around
AS SYSDBA, i.e.
sqlplus / as sysdba works from the OS prompt, whereas in 9.2 you need to do
sqlplus "/ as sysdba"This makes a solution easy:
SQLPLUS="/usr/oracle/product/10.1.0/bin/sqlplus -s xxx/xxxxxx@xxxx as sysdba"-- CJ -
SQL * PLUS WORKSHEET wrapping
I am using the SQL*Plus: Release 8.1.6.0.0 and the query gives us a wrapping results which is so hard to read and takes awhile to execute.
The default value for SQL*Plus LINESIZE is 80 and for PAGESIZE is 25. If the row of records select increases 80 then the records start wrapping. The suggestions are
1>. either limit the columns selected. i.e. instead of using SELECT * from TABLE use
SELECT col_a, col_b ... from TABLE
2>. increase the linesize by using the following
SET LINESIZE 300 ;
The valid values for linesize are 0 through 32767.
However, if you increase the linesize to a very high value, then you will need to do horizontal scroll to see all the columns. -
When I execute commands in SQL*PLUS, it is only using half of the screen and wrapping the data to the next line. Even a table that has only 4 columns of data gets wrapped so the screen looks messy and is difficult to read.
I went to Options and Buffer Width and changed it to 1000 and nothing happened. Is there any other changes I can make?
Thanks!!You'll probably need to set the linesize as well.
SET linesize 1000 -
How to wrap text for column level field
Hi,
In iSourcing module. I have requirement for RFQ response page. I have to wrapt text of table level column.
Screen have total 6 columns. First column heading is Line. This column displays item description. Length of Item description in VO is 240 characters.
Presently entire 240 characters are displayed in one line only. Because of this user has to scroll towards the right to see remaining columns.
Requirement is to wrap this first column contents so that all columns will get visible without scrolling.
How do I set this wrap functionality on this column through Controller?
I tried by following ways, but no luck,
1. In processRequest method
OAFlowLayoutBean ls_line = (OAFlowLayoutBean)oatablebean.findChildRecursive("Line");
if(ls_line != null)
ls_line.setWrapEnabled(true);
In personalize options of “Line” field there is no option for “No Wrap” property.
How can I achieve this column wrap functionality?
Kindly help,
Thanks in advance.
MandarHi Ajay,
This Flow Layout contains following items,
1. DocLineNumber(messageStyleText)
2. ItemDescription(messageStyleText)
Requirement is to wrap ItemDescription.
So i tried following code, but still no luck,
OATableBean oatablebean = (OATableBean)oawebbean.findChildRecursive("BidItemPricesTableVO");
OAMessageStyledTextBean ls_item_description = (OAMessageStyledTextBean)oatablebean.findChildRecursive("ItemDescription");
if(ls_item_description != null)
ls_item_description.setWrapEnabled(true);
XML file name: ponResponsePG.xml
File Location: $APPL_TOP/pon/12.0.0/mds/response/creation/webui/ponResponsePG.xml
I am not able to post ponResponsePG.xml file here(Your message exceeds the maximum length of 30000 characters.
), can i have your email id? i will email this file to.
Thanks and Regards,
Mandar -
Turn off display on sql*plus and increase memory for oracle?
I want to turn off the output display on SQL*PLUS window and SPOOL the output to a file since the result is very big. i tried to SET TERM OFF but it doesn't work. Anybody knows what's the problem? or is there some other commands to use? My oracle is 9i. thx!!! And anybody knows how to increase the memory usage size for Oracle's jrew.exe? it's too slow when i try to retrieve some big size data from oracle.
I just answered this question on the OTN -> General forum. You could try the SQL*Plus startup switch -s to startup SQL*Plus in silent mode, eg:
C:\SQLPLUS -S
Alison -
SQL*Plus: Comment appears in Default-Column
Please look at this commands, executed in SQL*Plus (Oracle 10g):
create table t1 (
c1 number,
c2 number default 0 -- comment in sqlplus
select column_name,data_default from all_tab_columns where table_name='T1';
COLUMN_NAME DATA_DEFAULT
C1
C2 0 -- comment in sqlplus
The comment is stored in the data dictionary! ?:|
insert into t1 (c1) values (0);
commit;
But the default clause works:
select c1,c2 from t1;
C1 C2
+0 0+
Is it a bug or is it a feature???
Greetings from Germany
WolfgangFrom: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_constraints.htm#sthref626
Setting Default Column Values
Default values can be defined using any literal
Bug or feature?
It depends on how literal you interprete literals?
!http://www.designer-daily.com/wp-content/uploads/2009/06/bug-feature.jpg! -
Language issues in SQL*Plus 8.1.7 for win 2000
Hi,
I installed Oracle Client 8.1.7 /Win 2000 release.
When I use SQL*Plus 8.1.7, I can not type nor read Arabic characters. My Win 2000 has all the Arabic components. And I am using AR8ISO8859P6 character set on both DB and Registry edit.
I feel like it is a bug in SQL*Plus 8.1.7 on win 2000.
Did anyone face such problem?? Do anyone have a solution?
(Note: When I type Arabic characters it is displayed as Latin characters. When I store them in DB and retrieve them from an other application they are retrieved correclty)
nullHi
I had similar problem with Cyrillic characters on previous version of Oracle on Windows NT 4.0. We could not find good solution for them. Only solution we found was to write sql commands in notepad and send it in SQL*Plus with copy and paste.
Regards
null -
SQL*PLUS: Setting a concrete RETURN CODE
I don't know how to force a concrete EXIT CODE for in a SQL*PLUS process.
I use "WHENEVER SQLerror EXIT SQL.SQLCODE" and a "EXIT SQL.SQLCODE;" at the end of the process.
But I need to be able to exit the process with a sqlcode "54" or "23" or whatever I want...
Any suggestions?
WHENEVER SQLerror EXIT SQL.SQLCODE
DECLARE
BEGIN
END;
EXIT SQL.SQLCODE;
-------------------------------------------------------You can just do EXIT n to exit with integer return code n.
$ sqlplus dqm
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Jan 11 11:48:46 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit 54
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
$ echo $?
54 -
Limitation in using sql *plus as a database for applications
dear experts;
I would like to know all, what are some of the major limitations in using sql*plus as your database in designing application besides the fact the user-interface is not friendly enough..and google is not producing relevant answers to my questions by the way unfortunatelyuser13328581 wrote:
I know about the drivers, I just need an IDE very similar to PL/SQL developer that will give me an opportunity to create the tables and their relationships and perform other DDL tasks that is why initially i was just wondering whether it is okay to utilize sql*plus for all that...SQLPlus can process any valid sql statement. Actually, it will pass anything that is not a sqlplus command to the database to be processed. The database will process any valid sql statement and pass the result back to the client to do with as the client sees fit - the client being sqlplus in this case.
Which is exactly what SQL Developer does. You say you want something "very similar to PL/SQL developer ". Why not SQL Developer itself?
It sounds like you continue to confuse the database with the client application. ("what are some of the major limitations in using sql*plus as your database ...", "I need an oracle database which can be integrated with visual studio ")
The database has no user interface at all. It accepts connection requests from clients, processes sql statements (or pl/sql blocks) passed from those clients and returns results to those clients. Those clients could be sqlplus, SQL Developer, Toad, Visual Basic, Access, Excel, or any number of other products -- all connecting to the same database at the same time, to do whatever they are programmed to do. You want to develop an app in visual studio? Be my guest. You want to use SQL Developer to create the tables, etc, needed by the app? Go right ahead. They are not mutually exclusive. You want to use sqlplus as well? Go ahead, it's the same database, just a different client app. -
Sql Plus Setting where It must searching Scripts
Hi
How can I to define inside Sql Plus with command , where It must search scripts
Why when I put :
@myscript.sqland inside there is other scripts, It not found
unable to open file "CONTIG_PS_LOC_ITM_TYPE.SQL"CONTIG_PS_LOC_ITM_TYPE.SQL is in same directory myscript.sqlHey
inside the your first script you can execute the second one as "@@CONTIG_PS_LOC_ITM_TYPE.SQL"
for the first script you can give the absolut path or the default path is $ORACLE_HOME/rdbms...
Regards -
SQL PLUS set column output side by side
I am trying to match my colum data with my row so when i query the data at least its readable side by side inside of top and bottom
cus_id
cus_name
999996
Allen
999997
Cameran
I want the ouput to look like this
cus-id cus_name
999996 Allen
999997 Cameran
thanks
Edited by: user11232525 on Dec 10, 2009 10:37 AMi tried that the the ouput this look messy - see below
CUS_ID
CUS_NAME
999901
Eaton
999902
Lane
999903
Cody
thanks -
SQL Plus: Set pagesize and line size
Can anyone help me make my output look better...... output below....what do I need to set?
CUST_ID
CUS_NAME
1
Leroy
2
Rama
3
Riley
4
Adena
5
Stuart
6
Jena
7
Tanisha
8
Shellie
9
Ignacia
10
Reubenbtw you can use ** tags for preserving formatting code and results in this forum. See the FAQ for more formatting help.
Maybe you are looking for
-
New Host Adapter plugin for Illustrator CC 2014?
I'm seeing that the Host Adapter plugin for Illustrator CC does not work for Illustrator CC 2014. I've checked that the AIHostAdapater.aip file is installed in the correct AI CC 2014 folder. But calling AIEventAdapater.getInstance().pingPlugIn() al
-
Trouble Connecting Original Airport card on eMac 700 to wi-fi network
I have an eMac 700Mhz with an original Airport card (801.11b). The card will find our home Wi-Fi network (Linksys 801.11n)but when I provide the WEP password, the eMac Airport Card will not connect. Any ideas Thanks!
-
The 'new tab' button is missing
I have just installed Firefox 6 but no longer have on display the small tab on the right of the open tab. I can only open a new tab with Ctrl + T (or from File & New Tab). Any obvious settings that I need to select to get this back? Thanks. (OS Win X
-
Trouble loading webpage in safari ... Blank Image
A friend of mine send me an webpage he has been working on and for some reason it will not load in Safari. I have been through the code, renamed, and deleted to no avail. The page loads fine in Firefox. The only thing that I can figure out is that if
-
10g OCP certificate not received(waiting for 2 months)
Hi, I have sent details requested for cetificate processing to [email protected] and given below is the copy of the details. Full Name: xxxx Oracle Testing id: xxxxx Exam Taken : 1Z0-040-ENU: Oracle Database 10g: New Features for Administrators Score