Question: PL/SQL Function that transforms a row into a BSON Document. Task 1) Implement a stored PL/SQL function that transforms a trip selected from TRIP table
PL/SQL Function that transforms a row into a BSON Document.

Task 1) Implement a stored PL/SQL function that transforms a trip selected from TRIP table and trip legs selected from TRIPLEG table into a single BSON document. The document must have a hierarchical structure must not contain any redundancies. A BSON document must be returned by the function as a string of characters. The function must have one input parameter to pass information about a trip number. If a trip with a given number does not exist then the function must return an empty BSON document. A name of the stored function is up to you. Create SQL script solution1.sql with CREATE OR REPLACE FUNCTION statement that compiles the function and saves it in a data dictionary Next, include into a script solution1.sql three SELECT statements that test the stored function. One of the statements must return an empty BSON document and one of the statements must return BSON document with a trip that has at least two legs. When ready process SQL script solution1.sql and record the results of processing in a file solution1.lst. You can use a command line interface MongoDB system to verify the correctness of your transformation, however, no report from the verification is required Your report from processing of SQL script solution1.sql must include a listing of all PL/SQL statements processed. To achieve that put the following SQL Plus commands: SPOOL file-name SET ECHO ON SET FEEDBACK ON SET LINESIZE 100 SET PAGESIZE 200 SET SERVEROUTPUT ON at the beginning of SQL script and SPOOL OFF at the end of SQL script
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
