Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Example of Using Aggregation on Nested Tables
Example: How many students sat each exam
WITH C_ER AS (SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM_MARK AS EM WHERE EM.CourseId = C.CourseId) AS ROW ( StudentId SID, Mark INTEGER ) MULTISET) AS ExamResult FROM COURSE AS C) SELECT CourseId, (SELECT COUNT (*) FROM TABLE (ER (ExamResult)) AS t) AS n FROM C_ER
Explanation
CREATE FUNCTION ER
(SM ROW ( StudentId SID, Mark INTEGER ) MULTISET )
RETURNS TABLE (StudentId SID, Mark INTEGER)
RETURN SM;
The type name TABLE ( StudentId SID, Mark INTEGER ) is actually just a synonym for ROW (StudentId SID, Mark INTEGER ) MULTISET). The misleading synonym is available only in a RETURNS clause and not as a parameter type, for example. So ER is actually a no-op, returning its input.
Predefined Exceptions The internal exception is raised implicitly whenever your PL/SQL program exceeds a system-dependent limit or violates an Oracle rule. Each & every Oracle
At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean's wants to create a trigger that automatically updates the stock level of all pr
Keyword & Parameter Description: WHEN: This keyword introduces the exception handler. You can have many exceptions execute the similar sequence of the statements by follo
Rephrase Conditional Control Statements When computing a logical expression, the PL/SQL uses short-circuit evaluation. That is, the PL/SQL stops evaluating the expression as s
Inserting Objects: You can use the INSERT statement to add objects to an object table. In the illustration below, you insert a Person object into the object table persons:
Defining REF CURSOR Types To make cursor variables, you take 2 steps. At first, you define a REF CURSOR type, and then declare the cursor variables of that type. You can defin
Managing Cursors The PL/SQL uses 2 types of cursors: implicit and explicit. The PL/SQL declares a cursor implicitly for all the SQL data manipulation statements, including th
Defining and Declaring Records To create records, you have to define a RECORD type, and then declare records of that type. You may also define RECORD types in the declarative
Parameter Aliasing To optimize the subprogram call, the PL/SQL compiler can decide between the two techniques of the parameter passing. With the by-value techniques, the v
#quesWrite a cursor to open an employee database and fetch the employee record whose age is greater than 45.tion..
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd