# The below
following query returns all the objects contained in Database schema:
SELECT
object_name, object_type FROM USER_OBJECTS;
# Verify the all objects :
SELECT
owner, object_name, object_type FROM ALL_OBJECTS;
# DBA object :
SELECT owner, object_name, object_type FROM SYS.DBA_OBJECTS;
# What is the Dual Table
:
It is the dummy table (Pseudo
table). It has one column, DUMMY,
defined to be VARCHAR2(1). DUAL is in the schema of the user SYS but is
accessible by the name DUAL to all users.
SQL> select user from dual;
USER
------------------------------
HR
SQL> select sysdate from dual;
SYSDATE
---------
22-JUN-15
SQL> select
2
to_char(to_date('25-MAR-1956','dd-mon-yyyy'),'day')
3 from dual;
TO_CHAR(T
---------
sunday
Generate 1 to N no using
below query:
(Change the Level
<=100 if you wanted to generate 1 to 100)
CONNECT BY LEVEL : This
condition would be identifies the relationship between parent rows and child
rows of the hierarchy.
Syntax
1 CONNECT BY [NOCYCLE]
<condition> START
WITH <condition>
Syntax
2 START WITH
<condition> CONNECT
BY [NOCYCLE] <condition>
SQL> SELECT LEVEL n FROM DUAL
CONNECT BY LEVEL <= 10;
N
----------
1
2
3
4
5
6
7
8
9
10
10 rows selected.
SQL>
0 Comments