• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 722
  • Last Modified:

Q question related to break on object_type skip 1

Hi; Following is oracle sql script and its result. I do not understand what does this 'break on object_type skip 1 ' mean?
It does not mention in the book. Beginning Oracle programming. Chapter 4. Finding Out More About the Sample Schemas


==================================================================================
column object_name format a30
column tablespace_name format a30
column object_type format a12
column status format a1
break on object_type skip 1                                       <-------------------------------------what does it mean?

select object_type, object_name,
       decode(status,'INVALID','*','') status,
       tablespace_name
  from user_objects a, user_segments b
 where a.object_name = b.segment_name (+)
   and a.object_type = b.segment_type (+)
 order by object_type, object_name
/
column status format a10
OBJECT_TYPE  OBJECT_NAME                S TABLESPACE_NAME
-----------------  ------------------------------ - ------------------------------
INDEX              COUNTRY_C_ID_PK             EXAMPLE
                        DEPT_ID_PK                       EXAMPLE

PROCEDURE    ADD_JOB_HISTORY
                       SECURE_DML

SEQUENCE     DEPARTMENTS_SEQ
                      EMPLOYEES_SEQ
                      LOCATIONS_SEQ

TABLE            COUNTRIES
                     DEPARTMENTS                      EXAMPLE
                     EMPLOYEES                          EXAMPLE


TRIGGER      SECURE_EMPLOYEES
                   UPDATE_JOB_HISTORY
VIEW          EMP_DETAILS_VIEW

34 rows selected.

 

 
0
JianJunShen
Asked:
JianJunShen
2 Solutions
 
Jinesh KamdarCommented:
Setting A BREAK point
---------------------------
If you have a query that selects some repeating data, or you want to section out different rows, you
can set up a break point to do this. For example, if you have a query which simply selects the deptno
and ename columns from emp, you may want to section out rows for each department, and also only
print the department each time it changes.

Example Before
=============
DEPTNO ENAME
--------- --------
10 CLARK
10 KING
10 MILLER
20 SMITH
20 ADAMS

If you first entered:

SQL> BREAK ON deptno SKIP 1

You would have:
DEPTNO ENAME
--------- --------
10 CLARK
KING
MILLER
20 SMITH
ADAMS

The BREAK command says: set up a BREAK point on deptno and skip a line each time it changes.
0
 
sujith80Commented:
>> break on object_type skip 1                                      
This is a formatting clause used in sqlplus reports.
BREAK ON object_type - groups together records with the same object_type and displays the object type value only for the first record.
SKIP 1 - skips one line after each group of object_types.

For this setting to work; the query used in the report should have an order by clause, in which you use order by <column used to set BREAK on>
SKIP <n> skips n lines
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now