Link to home
Start Free TrialLog in
Avatar of duta
duta

asked on

sql*plus 9: set linesize 100?

Dear experts:

I am using "set linesize 100" command to change the line size.

But for now, I have to use the command everytime I start sql*plus.

Is there any way to make the linesize permanently 100 so that I may not type "set linesize 100" every time?

Thanks!
Avatar of gripe
gripe

Avatar of duta

ASKER

TO: gripe:

Thank you very much for your kind tips.

By the way, I checked the two links you kindly gave me. But I could not find any specific tips to
set the linesize permanently 100.

Thanks!
In $ORACLE_HOME/sqlplus there is a file called 'glogin.sql' that allows you to set permanent settings for sqlplus. If you look in this file, you'll see what I mean.

Additionally, in the second tip, the STORE SET filename REPLACE command allows you to save the 'state' of your current SQL*Plus session to be re-executed later (with @filename)
Also in that FAQ:

Can one run commands when SQL*Plus starts up?

When SQL*Plus starts up, it will look for a global login script called glogin.sql in the $ORACLE_HOME/sqlplus/admin directory. If found, this script will be executed.

Thereafter, sqlplus will try to find a local login script called login.sql. It will look for the login.sql script in the directory where you start sqlplus from, alternatively it will search the directories listed in the SQLPATH environment variable for such a script. When found, sqlplus will execute it.
In my second to last post, that should have been '$ORACLE_HOME/sqlplus/admin'.. Sorry for the typo.
Avatar of duta

ASKER

TO: gripe:

I checked the file and found the following script.

To permanently set the linesize at 100, which one may I need to modify?

Thanks a lot!

_________________glogin.sql ____________________________




--
-- Copyright (c) Oracle Corporation 1988, 2000.  All Rights Reserved.
--
-- NAME
--   glogin.sql
--
-- DESCRIPTION
--   SQL*Plus global login startup file.
--
--   Add any sqlplus commands here that are to be executed when a user
--   starts SQL*Plus on your system
--
-- USAGE
--   This script is automatically run when SQL*Plus starts
--

-- For backward compatibility
SET PAGESIZE 14
SET SQLPLUSCOMPATIBILITY 8.1.7

-- Used by Trusted Oracle
COLUMN ROWLABEL FORMAT A15

-- Used for the SHOW ERRORS command
COLUMN LINE/COL FORMAT A8
COLUMN ERROR    FORMAT A65  WORD_WRAPPED

-- Used for the SHOW SGA command
COLUMN name_col_plus_show_sga FORMAT a24

-- Defaults for SHOW PARAMETERS
COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE

-- Defaults for SET AUTOTRACE EXPLAIN report
COLUMN id_plus_exp FORMAT 990 HEADING i
COLUMN parent_id_plus_exp FORMAT 990 HEADING p
COLUMN plan_plus_exp FORMAT a60
COLUMN object_node_plus_exp FORMAT a8
COLUMN other_tag_plus_exp FORMAT a29
COLUMN other_plus_exp FORMAT a44
Avatar of duta

ASKER

Just a reminder: I posted another question: How to change a long command in  two separate lines?

ASKER CERTIFIED SOLUTION
Avatar of gripe
gripe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of duta

ASKER

Thanks a lot, grip. It is awesome!

duta
Also, I don't see any new questions for you in the Oracle topic area.
Avatar of duta

ASKER

gripe, I just re-posted the question: The link is: https://www.experts-exchange.com/questions/22130891/Sql-Plus-How-to-change-the-line-when-using-a-long-command.html


I thought that I posted the same question earlier. But it was not posted for some reason.

thanks!

duta