SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Oracle - Collections Kaushik Raghupathi
What is a Collection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Index by Table - Associative Array ,[object Object],[object Object],[object Object],DECLARE    TYPE population_type IS TABLE OF NUMBER INDEX BY VARCHAR2(64);    country_population population_type;   howmany NUMBER; BEGIN   country_population('Greenland') := 100000;   country_population('Iceland') := 750000;   howmany := country_population('Greenland'); END; /
Index by Table - Associative Array ,[object Object],[object Object]
Nested Tables ,[object Object],[object Object],[object Object],[object Object],[object Object],DECLARE    TYPE CourseList IS TABLE OF VARCHAR2(16);    my_courses CourseList; BEGIN    my_courses :=       CourseList('Econ 2010', 'Acct 3401', 'Mgmt 3100');       dbms_output.put_line(my_courses(1)); END; /
Nested Tables ,[object Object]
vArray ,[object Object],[object Object],[object Object],[object Object],DECLARE    TYPE CourseList IS VARRAY(50) OF VARCHAR2(16);    my_courses CourseList; BEGIN    my_courses :=       CourseList('Econ 2010', 'Acct 3401', 'Mgmt 3100'); END;
VARRAY ,[object Object]
Initializing, Extend, Count, Delete ,[object Object]
Key Aspects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Passing Collections as Parameters DECLARE    TYPE Roster IS TABLE OF VARCHAR2(15);    names Roster := Roster('J Hamil', 'D Piro', 'R Singh');    i BINARY_INTEGER := 2; BEGIN    verify_name(names(i));  -- call procedure END;
Using Collections in Tables CREATE TYPE ProjectList AS VARRAY(50) OF VARCHAR2(16); /   CREATE TABLE department (  -- create database table    dept_id  NUMBER(2),    name     VARCHAR2(15),    budget   NUMBER(11,2), -- Each department can have up to 50 projects.    projects ProjectList) /
Using Collections in Tables INSERT INTO department     VALUES(60, 'Security', 750400,       ProjectList('New Badges', 'Track Computers', 'Check Exits'));     Try selecting data from the table
Using Collections in Tables SELECT a.* FROM TABLE(SELECT projects FROM department) a

Weitere ähnliche Inhalte

Was ist angesagt?

06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
Bishal Ghimire
 
Oracle Course
Oracle CourseOracle Course
Oracle Course
rspaike
 

Was ist angesagt? (20)

SQL Commands
SQL Commands SQL Commands
SQL Commands
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
 
SQL
SQLSQL
SQL
 
PL/SQL - CURSORS
PL/SQL - CURSORSPL/SQL - CURSORS
PL/SQL - CURSORS
 
Sql Functions And Procedures
Sql Functions And ProceduresSql Functions And Procedures
Sql Functions And Procedures
 
Sql commands
Sql commandsSql commands
Sql commands
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Introduction to PL/SQL
Introduction to PL/SQLIntroduction to PL/SQL
Introduction to PL/SQL
 
Sql Tutorials
Sql TutorialsSql Tutorials
Sql Tutorials
 
Sql Constraints
Sql ConstraintsSql Constraints
Sql Constraints
 
Restricting and Sorting Data - Oracle Data Base
Restricting and Sorting Data - Oracle Data BaseRestricting and Sorting Data - Oracle Data Base
Restricting and Sorting Data - Oracle Data Base
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Plsql
PlsqlPlsql
Plsql
 
Oracle Course
Oracle CourseOracle Course
Oracle Course
 
Including Constraints -Oracle Data base
Including Constraints -Oracle Data base Including Constraints -Oracle Data base
Including Constraints -Oracle Data base
 
04 Handling Exceptions
04 Handling Exceptions04 Handling Exceptions
04 Handling Exceptions
 
[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL
 
Odi interview questions
Odi interview questionsOdi interview questions
Odi interview questions
 

Ähnlich wie Oracle Collections

Exploring collections with example
Exploring collections with exampleExploring collections with example
Exploring collections with example
pranav kumar verma
 
BHARGAVIARRAY.PPT.pptx
BHARGAVIARRAY.PPT.pptxBHARGAVIARRAY.PPT.pptx
BHARGAVIARRAY.PPT.pptx
Sasideepa
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
Vikas Gupta
 

Ähnlich wie Oracle Collections (20)

Collection
Collection Collection
Collection
 
Exploring collections with example
Exploring collections with exampleExploring collections with example
Exploring collections with example
 
Lists and arrays
Lists and arraysLists and arrays
Lists and arrays
 
AMIS - Can collections speed up your PL/SQL?
AMIS - Can collections speed up your PL/SQL?AMIS - Can collections speed up your PL/SQL?
AMIS - Can collections speed up your PL/SQL?
 
23. SQL and Database.pdf
23. SQL and Database.pdf23. SQL and Database.pdf
23. SQL and Database.pdf
 
Lecture 2a arrays
Lecture 2a arraysLecture 2a arrays
Lecture 2a arrays
 
23. SQL and Database.pdf
23. SQL and Database.pdf23. SQL and Database.pdf
23. SQL and Database.pdf
 
MY SQL
MY SQLMY SQL
MY SQL
 
98765432345671223Intro-to-PostgreSQL.ppt
98765432345671223Intro-to-PostgreSQL.ppt98765432345671223Intro-to-PostgreSQL.ppt
98765432345671223Intro-to-PostgreSQL.ppt
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
BHARGAVIARRAY.PPT.pptx
BHARGAVIARRAY.PPT.pptxBHARGAVIARRAY.PPT.pptx
BHARGAVIARRAY.PPT.pptx
 
Plsql arrays
Plsql arraysPlsql arrays
Plsql arrays
 
Difference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleDifference Between Sql - MySql and Oracle
Difference Between Sql - MySql and Oracle
 
1 introduction to my sql
1 introduction to my sql1 introduction to my sql
1 introduction to my sql
 
arrays-130116232821-phpapp02.pdf
arrays-130116232821-phpapp02.pdfarrays-130116232821-phpapp02.pdf
arrays-130116232821-phpapp02.pdf
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
OOPs with java
OOPs with javaOOPs with java
OOPs with java
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Oracle Collections

  • 1. Oracle - Collections Kaushik Raghupathi
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Passing Collections as Parameters DECLARE    TYPE Roster IS TABLE OF VARCHAR2(15);    names Roster := Roster('J Hamil', 'D Piro', 'R Singh');    i BINARY_INTEGER := 2; BEGIN    verify_name(names(i));  -- call procedure END;
  • 12. Using Collections in Tables CREATE TYPE ProjectList AS VARRAY(50) OF VARCHAR2(16); /   CREATE TABLE department (  -- create database table    dept_id  NUMBER(2),    name     VARCHAR2(15),    budget   NUMBER(11,2), -- Each department can have up to 50 projects.    projects ProjectList) /
  • 13. Using Collections in Tables INSERT INTO department     VALUES(60, 'Security', 750400,       ProjectList('New Badges', 'Track Computers', 'Check Exits'));     Try selecting data from the table
  • 14. Using Collections in Tables SELECT a.* FROM TABLE(SELECT projects FROM department) a