this section is an : introduction to pl/sqldb.suvenconsultants.com/section2_oracle-pl-sql.pdf ·...

28
Section 8 ( Not a part of 1Z0 061 oracle Certification test # ) db.suven.net db.suven.net 1 # PL/SQL is completely covered under Oracle Database 11gProgram with PL/SQL ( 1Z0- 144 ) training conducted by Rocky Sir. Please refer http://db.suven.net for TT and Curriculum. To become an OCA , one has to under go Training for 1Z0-061 ( 12c SQL ) and 1Z0-144 ( 11g PL/SQL ). You can view following link on Oracle web site also : http://education.oracle.com/pls/web_prod-plq- dad/db_pages.getpage?page_id=458&get_params=p_track_id:PLSQl Kindly Note Oracle 12c PL/SQL Certification path would be launching in Jan 2016 in India. This section is an : Introduction to PL/SQL

Upload: truongduong

Post on 07-Feb-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Section 8 ( Not a part of 1Z0 – 061 oracle Certification test # )

db.suven.net

db.suven.net 1

# PL/SQL is completely covered under “ Oracle Database 11g–Program with PL/SQL ” ( 1Z0-144 ) training conducted by Rocky Sir. Please refer http://db.suven.net for TT and

Curriculum. To become an OCA , one has to under go Training for 1Z0-061 ( 12c SQL )and 1Z0-144 ( 11g PL/SQL ). You can view following link on Oracle web site also :http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=458&get_params=p_track_id:PLSQl

Kindly Note Oracle 12c PL/SQL Certification path would be launching in Jan 2016 in India.

This section is an : Introduction to PL/SQL

PL/SQL

Internal working

db.suven.net 2

DeclareX int;BeginSELECT salary into X FROM employees_recordWHERE first_name='Kevin';dbms_output.put_line('Value of X is '|| X);IF X>10000 THENINSERT INTO tempp values(X,'HIGH SALARY');ELSEINSERT INTO tempp values(X,'LOW SALARY');END IF;END;/

Sample code

Declaration block

body

End st.

db.suven.net 3

PL/SQLAdvantages

1> Integration

db.suven.net 4

2> Performance

db.suven.net 5

3> Modularize Program Development

4> Other Advantages

db.suven.net 6

Benefits of Sub programs: Functions and Procedures

1. From User Interface

2. From Oracle tools

3. From another SP

4. From External libraries or other applications

db.suven.net 7

Recall : About PL/SQL

db.suven.net 8

PL/SQL declarations

db.suven.net 9

PL/SQL Block Declaration : 3 possible Block types

Handling Variables in PL/SQL :

db.suven.net 10

Syntax :Variable in PL/SQL :

Guidelines

db.suven.net 11

How to print data ?

SQL functions in PL/SQL

db.suven.net 12

Controlling Flow of Execution

db.suven.net 13

db.suven.net 14

Iterative Control : loop statements

db.suven.net 15

Syntax :Basic loop

db.suven.net 16

Example :Basic loop

db.suven.net 17

Syntax :While loop

Example :While loop

db.suven.net 18

Syntax :FOR loop

Note :

db.suven.net 19

Example :For loop

db.suven.net 20

Procedure and Functions

Syntax of sub program:

What is a procedure ?

db.suven.net 21

Syntax of procedure

db.suven.net 22

What is a Function?

Syntax of function

db.suven.net 23

Example of function

Locations from where we can call functions

db.suven.net 24

Difference between Procedure and function ?

db.suven.net 25

What is a Trigger ?

db.suven.net 26

Trigger contains :

db.suven.net 27

DML trigger components

db.suven.net28