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
Reuben
btw you can use ** tags for preserving formatting code and results in this forum. See the FAQ for more formatting help.
Similar Messages
-
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? -
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 -
Dbms_lob and line size problem
Hi,
below is a simple function which returns a CLOB.
When I call this function from sqlplus and spool the result in a
file via the SPOOL command I get a line break after 80 characters.
When I replace in the function the CLOB type with a VARCHAR2 type
the whole TESTSTRING is printed on ONE line.
I do specify 'SET LINESIZE 200' in both cases and the length of
TESTSTRING is smaller than 200 characters.
How can I increase the line size for the CLOB case ?
CREATE OR REPLACE FUNCTION GetSimple (
RETURN CLOB
IS
RESULT CLOB;
TESTSTRING CONSTANT VARCHAR2(4000) := '123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_AFTER_LINEBREAK' ;
BEGIN
-- create CLOB for RETURN
dbms_lob.createtemporary(RESULT, TRUE);
dbms_lob.writeappend(RESULT, length(TESTSTRING), TESTSTRING);
RETURN RESULT;
END GetSimple;
/problem solved !
I had to add
SET LONGCHUNKSIZE 4096;
default is 80 -
SQL*Plus 'Copy' command and LONG datatypes
Hi. I'm using Oracle 9.2.0.5 and wanna copy LONG to LONG without using an Interface in VB or any other programming language.
Some of the fields (plain text) are greater than 32 Kb, and I tried the SQL*Plus 'Copy' command, without success.
(For compatibility reasons I can't convert LONG to CLOB, I need to copy LONG to LONG)
This is the example I'm working with:
Table Source_LONG (ID number, DATA long)
Table Destination_LONG (ID number, DATA long)
The SQL*Plus command: (connected from test_database@environment)
set long 100000
copy from test_database/test_database@environment insert destination_long (id,data)
I tried using both FROM and TO, but same results.
The fields are copied into destination_long, but they are
truncated at 32768 bytes, even with the LONG variable set to 100000. Any ideas ?
Thanks.I'm working with 2 similar tables with this structure:
SOURCE_LONG (ID number, DATA long)
DESTINATION_LONG (ID number, DATA long)
SOURCE_LONG contains two rows:
ID DATA
1 hello
3 ....text bigger than 32kb...
I tried your solution and it insert 2 rows, but only the ID is filled. The DATA is empty in both cases :-(
insert into destination_long(id,data) (select id,to_lob(data) from source_long); -
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 -
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 -
SQL Plus / Oracle - Username and Password Troubles
Hello all
I have just download Oracle Database 10g Express Edition for Linux.
When i use the command 'connect' with SQL Plus i am required to enter a username ans password.
What is the default username and password, or where can i find it?
Many thanks1. If you installed the express edition, there is another step. Go to your GUI menu->Oracle->Documentation. Those names are not exactly right, but you should be able to figure them out from that
2. You are missing a post install step which the install documentation will tell you from step 1. If it is a regular Linux, you drop to a terminal and type something like "database configure". Look at the install documentation, it will tell you.
3. Do you have Apache running? You need a web server for the Oracle web interface to work
4. The error message you got means exactly what it says. That being said, you can also get this error message when the database is running. If you do, it is because you forgot to include a connection on you command:
connect sys/manager@xe
OR
connect sys/manager@localhost:1521Since you don't know the passwords, I assumed you did not run the configure step above since it asks for the password when you run it.
Loyal -
SQL PLUS log input and output to file
What is the way to log every activity in sqlplus, input and output to a file (interactively).
I managed to do it using rlwrap and tee but the only problem is, it is displaying the password and logging it into file as well :D. I can remove it from the logfile but am unable to prevent from showing the password.
I hope many might have wanted to do this, and some might have been succeeded. Please share your ideas!N:\tools>sqlplus siva
SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 19 03:12:04 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password: password
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining optionsThe password is displayed on screen and it is in the log file as well.
Here is the some environmental setup;
I've installed cygwin with rlwrap package
I've renamed the original sqlplus.exe to _sqlplus.exe
I've placed mysqlplus.bat and sqlplus.bat in N:\tools and this location includes in the pathwhere sqlplus.bat contains
@echo off
rlwrap -a"Enter" mysqlplus.bat %*perhaps this is more related to linux commands but I want to log input and output of sqlplus!
:) -
How to install SQL*Plus help facilities and demos.
Hi, everyone
It appears error message say "failure to login" during SQL*Plus
part of the Oracle8 full installation. I knew that system want
to install SQL*Plus help and demos through logining one of
dba account(maybe system user account). However, due to
password's reason, can not log in SQL*Plus, so installer can't
execute named pupbld.sql script, result in SQL*Plus help and
demos can not be installed.
Now, I am intend to install these stuff lonely.
Could anyone help me? thank a lot.
William
nullHi,
The pupbld.sql isn't the correct script to create the help
facility, it just creates product and user profile tables.
The help script is at $ORACLE_HOME/sqlplus/admin/help (run as
system)
cd $ORACLE_HOME/sqlplus/admin/help
sqlplus system/<password> @helptbl
sqlldr system/<password> control=plushelp.ctl
sqlldr system/<password> control=plshelp.ctl
sqlldr system/<password> control=sqlhelp.ctl
sqlplus system/<password> @helpindx
I think it is necessary to run the pupbld.sql script, without
this script everyone who logins in oracle with sqlplus will see
an error message, but... Run the script again:
$ORACLE_HOME/sqlplus/admin/pupbld.sql
Best regards,
Ari
William (guest) wrote:
: Hi, everyone
: It appears error message say "failure to login" during SQL*Plus
: part of the Oracle8 full installation. I knew that system want
: to install SQL*Plus help and demos through logining one of
: dba account(maybe system user account). However, due to
: password's reason, can not log in SQL*Plus, so installer can't
: execute named pupbld.sql script, result in SQL*Plus help and
: demos can not be installed.
: Now, I am intend to install these stuff lonely.
: Could anyone help me? thank a lot.
: William
null -
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 -
Setting textArea and Button Size
Hi with a TextArea is there a way to set the text area so that you only can type in the box and the words will wrap when they get to the end? I dont want the text that a user types to keep on extending until the user click enter which brings them to the next line. I want it so that when the user hits the end of the text box in the applet they are brought to the next line of the text box without having to hit enter. i dont want them to have to scroll to see all of thier text.
Also can I use a constructor to resize the default buttons created with java? i want my buttons to be a ceratain square size to fill the applet. The Default Buttons are small but I want my Buttons to fill a section of my panel. Here is my code. I am using a grid layout.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.lang.*;
import java.math.*;
public class TextChat extends Applet
private Button new_chat, begin;
private Label errors;
private TextArea text_top, text_bottom;
public void init()
//Set Layout
setLayout( new GridLayout(3, 1, 10, 10));
text_top = new TextArea();
text_bottom = new TextArea();
add (text_top);
add(MidPanel());
add (text_bottom);
// Set Mid Panel
public Panel MidPanel()
Panel p = new Panel( new GridLayout(1, 3, 5, 5) );
//Set up Buttons
new_chat = new Button("New Chat");
begin = new Button("Begin");
errors = new Label("Errors: ");
Panel p1 = new Panel();
p1.add(new_chat);
Panel p2 = new Panel();
p2.add(begin);
Panel p3 = new Panel();
p3.add(errors);
p.add(p1);
p.add(p2);
p.add(p3);
return p;
}ThanksI tried this
TextArea text_top = new TextArea();
TextArea text_bottom = new TextArea();
text_top.setLineWrap(true);I get a error
method setLineWrap (boolean)
It points to the text_top"."setLinewarp as the
error?
I looked up examples and they all used swing
ThanksThe examples might use swing but you are using AWT!!
change to
JTextArea text_top = new JTextArea();
JTextArea text_bottom = new JTextArea();
text_top.setLineWrap(true); -
Scan directly into Aperture - setting dpi and output size?
Am I able to scan an old photo from a flatbed scanner directly into Aperture.
Set the dpi before along with the output/print size I want?
thx
DebI've been researching this for my project too. Here's 3 great articles I found on migrating your film scans to Aperture via Automator.
http://www.kremalicious.com/2008/05/scan-images-directly-into-apple-aperture/
http://www.oreillynet.com/pub/a/oreilly/digitalmedia/2007/05/25/digitizing-your- film-archive.html?page=1
http://blogs.oreilly.com/aperture/2008/09/some-tips-on-scanning-film-int.html -
Sql*plus hiding username and password
Hi All,
I was wondering if there is a way that I can avoid
having to specify username and password when I execute
sqlplus and sqlldr on Unix systems.
I know that If I don't specify a username or password
these programs will prompt for one. That is fine
when I am executing thing in a interactive shell but
if I want to execute these programs from a cron job
I need to have the username and password in my crontab
file and when they execute other users can see my
username and password by executing ...
ps -ef
... How can I correct this problem?Actually, Oracle Corp. provides a very neat solution to the password problem.
They have a program, called 'hide' which they provide the source for.
Search on Metalink for Note 1009091.6: "HOW DO YOU HIDE USERNAME/PASSWORD IN PS?"
You compile it on your system and you when you want to invoke sqlplus, for instance, you run 'hide sqlplus userid/password'.
The difference is, that when you run a ps, all you see is sqlplus, without the userid and password displayed.
You can rename sqlplus to something else and create a shell script called sqlplus that calls hide.
That way is transparent to the user. Everyone just runs sqlplus like they always have. -
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
Maybe you are looking for
-
Smartforms and its internal table
Hi All! From the main program, I call the FM SSF_FUNCTION_MODULE_NAME and later "call lf_fm_name" as below shown. The generated FM name gets an "internal table" in the tables parameter. And now how can I to treat now this internal table within smart
-
BPM - IDoc to SOAP problem (Unable to convert sender service)
Hi, I have a BPM scenario where I'm sending an Idoc from r/3 to XI to SOAP. As part of my scenario I'm sending an acknowledgment (ALEAUD) back to R/3. I'm getting Unable to convert sender service IP_BPEL_INBOUND_ORDER to an ALE logical system on th
-
Is there another way to download music to iPods without using iTunes
Do I have to use iTunes to download music to our ipods
-
Linking word documents and auto-updating TOCs?
Hi, all! I know InDesign a bit, but am about to embark on a project that I could use some help on. Im compiling all the different writing Ive done in the past four years into a little ebook. There are about 50 different essays/articles, each under fo
-
WHY IS THE BATTERY IS NOT CHRGING
my mack pro labtop 13.1 suddenly shoed that battery is noy working, I bought it less than one year ,and I didn't use it during the last three months