11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.
-
Upload
kory-charles -
Category
Documents
-
view
215 -
download
0
Transcript of 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.
![Page 1: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/1.jpg)
1111
Copyright س Oracle Corporation, 2000. All rights reserved.®
Overview of PL/SQLOverview of PL/SQL
![Page 2: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/2.jpg)
1-1-22 Copyright س Oracle Corporation, 2000. All rights reserved.®
SQLSQLSQLSQL PL/SQLPL/SQLPL/SQLPL/SQL
ApplicationsApplications HRHR FinancialsFinancials ManufacturingManufacturing ......
ApplicationsApplications HRHR FinancialsFinancials ManufacturingManufacturing ......
Data tablesData tables
Data dictionaryData dictionary OracleOracleDatabaseDatabase
Oracle Discoverer Oracle Discoverer Oracle Discoverer Oracle Discoverer
Oracle DesignerOracle DesignerOracle DesignerOracle Designer
Oracle DeveloperOracle DeveloperOracle DeveloperOracle Developer
SQL* PlusSQL* PlusSQL* PlusSQL* Plus
Web-based Web-based applicationsapplicationsWeb-based Web-based applicationsapplications
MultitierMultitierapplicationsapplicationsMultitierMultitierapplicationsapplications
Oracle Complete SolutionOracle Complete Solution
![Page 3: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/3.jpg)
1-1-33 Copyright س Oracle Corporation, 2000. All rights reserved.®
PL/SQL Program ConstructsPL/SQL Program Constructs
AnonymousAnonymousblockblock
AnonymousAnonymousblockblock
ApplicationApplicationtriggertrigger
ApplicationApplicationtriggertrigger
Stored Stored procedure/procedure/
functionfunction
Stored Stored procedure/procedure/
functionfunction
DatabaseDatabasetriggertrigger
DatabaseDatabasetriggertrigger
ApplicationApplicationprocedure/procedure/
functionfunction
ApplicationApplicationprocedure/procedure/
functionfunction
PackagePackagePackagePackage
DECLAREDECLARE
BEGINBEGIN
EXCEPTIONEXCEPTION
END;END;
Object typeObject typeObject typeObject type
![Page 4: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/4.jpg)
1-1-44 Copyright س Oracle Corporation, 2000. All rights reserved.®
Block Structure for Anonymous PL/SQL Blocks
Block Structure for Anonymous PL/SQL Blocks
DECLARE (optional)Declare PL/SQL objects to be usedwithin this block
BEGIN (mandatory)Define the executable statements
EXCEPTION (optional)Define the actions that take place ifan error arises
END; (mandatory)
DECLARE (optional)Declare PL/SQL objects to be usedwithin this block
BEGIN (mandatory)Define the executable statements
EXCEPTION (optional)Define the actions that take place ifan error arises
END; (mandatory)
![Page 5: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/5.jpg)
1-1-55 Copyright س Oracle Corporation, 2000. All rights reserved.®
Block Structure for PL/SQL SubprogramsBlock Structure for PL/SQL Subprograms
Header
IS|AS
Declaration section
BEGIN
Executable section
EXCEPTION (optional)
Exception section
END;
Header
IS|AS
Declaration section
BEGIN
Executable section
EXCEPTION (optional)
Exception section
END;
![Page 6: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/6.jpg)
1-1-66 Copyright س Oracle Corporation, 2000. All rights reserved.®
Benefits of SubprogramsBenefits of Subprograms
• Improved maintenance
• Improved data security and integrity
• Improved performance
• Improved maintenance
• Improved data security and integrity
• Improved performance
![Page 7: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/7.jpg)
1-1-77 Copyright س Oracle Corporation, 2000. All rights reserved.®
Development EnvironmentsDevelopment Environments
• SQL*Plus uses the PL/SQL engine in the Oracle Server
• Procedure Builder uses the PL/SQL engine in the client tool or in the Oracle Server
• SQL*Plus uses the PL/SQL engine in the Oracle Server
• Procedure Builder uses the PL/SQL engine in the client tool or in the Oracle Server
![Page 8: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/8.jpg)
1-1-88 Copyright س Oracle Corporation, 2000. All rights reserved.®
Developing Procedures and Functions Using SQL*Plus
Developing Procedures and Functions Using SQL*Plus
![Page 9: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/9.jpg)
1-1-99 Copyright س Oracle Corporation, 2000. All rights reserved.®
Developing Procedures and Functions Using Oracle Procedure Builder
Developing Procedures and Functions Using Oracle Procedure Builder
![Page 10: 11 Copyright س Oracle Corporation, 2000. All rights reserved. ® Overview of PL/SQL.](https://reader036.fdocuments.in/reader036/viewer/2022082611/56649eb45503460f94bbbf75/html5/thumbnails/10.jpg)
1-1-1010 Copyright س Oracle Corporation, 2000. All rights reserved.®
SummarySummary
In this lesson, you should have learned that:
• Anonymous blocks are unnamed PL/SQL blocks
• Subprograms are named PL/SQL blocks, declared as either procedures or functions
• There are two main PL/SQL development environments:
– SQL*Plus
– Procedure Builder
In this lesson, you should have learned that:
• Anonymous blocks are unnamed PL/SQL blocks
• Subprograms are named PL/SQL blocks, declared as either procedures or functions
• There are two main PL/SQL development environments:
– SQL*Plus
– Procedure Builder