The Below records looks not perfect. Its messed up with all columns.

However, It should be more clear if these are like below;
However, It should be more clear if these are like below;
EID ENAME
DID
---- ------------ --------------
----- ------------- ----------
203 YK
50
204 LK
50
205 OP
50
Possible Solution : SQL statements are below.
SQL> set lines 256;
SQL> set trimout on;
SQL> set space 1;
SQL> set tab off;
You can also try this one.
Setting Up your Oracle for PL/SQL
Setting Up the SCOTT/TIGER Schema
Many of the examples in this book draw on the EMP/DEPT tables in the SCOTT
schema. We recommend that you install your own copy of these tables in some
account other than SCOTT to avoid side effects caused by other users using and
modifying the same data. To create the SCOTT demonstration tables in your own
schema, simply perform the following:
1. From the command line, run cd [ORACLE_HOME]/sqlplus/demo.
2. Log into SQL*Plus as the required user.
3. Run @DEMOBLD.SQL.
The DEMOBLD.SQL script will create and populate five tables for you. When it’s
complete, it exits SQL*Plus automatically, so don’t be surprised when SQL*Plus
disappears after running the script. If you would like to drop this schema at any
time to clean up, you can simply execute [ORACLE_HOME]/sqlplus/demo/demodrop.sql.
The SQL*Plus Environment
The examples in this book are designed to run in the SQL*Plus environment.
SQL*Plus provides many useful options and commands that we’ll make frequent
use of throughout this book. For example, a lot of the examples in this book use
DBMS_OUTPUT in some fashion. In order for DBMS_OUTPUT to work, the following
SQL*Plus command must be issued:
SQL> set serveroutput on
Alternatively, SQL*Plus allows us to set up a LOGIN.SQL file, a script that is
executed each and every time we start a SQL*Plus session. In this file, we can set
parameters such as SERVEROUTPUT automatically. An example of a LOGIN.SQL script
is as follows (you can edit it to suit your own particular environment):
define _editor=vi
set serveroutput on size 1000000
set trimspool on
set long 5000
set linesize 100
set pagesize 9999
column plan_plus_exp format a80
Furthermore, we can use this script to format our SQL*Plus prompt so that
we always know who we’re logged in as and on which database. For example, as
you work through this book, you’ll encounter prompts of the following format:
scott@oracle9i_test>
This tells you that you’re logged into the SCOTT schema on the ORACLE9I_TEST
database. The following is the code in the LOGIN.SQL script that achieves this:
column global_name new_value gname
set termout off
select lower(user) || '@' ||
xx
global_name from global_name;
set sqlprompt '&gname> '
set termout on
0 Comments