Question
Working with loops and nested loops in the scope of an anonymous PL/SQL program, enter the unique elements of the Twelve Days of Christmas into
Working with loops and nested loops in the scope of an anonymous PL/SQL program, enter the unique elements of the Twelve Days of Christmas into collections and then print the lyrics of the song.
You need to write an anonymous block PL/SQL program that uses two collections. One collection implements a list of eight character variable length strings. The other collection implements a list of the following object type, which you need to create:
Object Type: STRUCT | |||||
---|---|---|---|---|---|
Member Name | Member Type | ||||
day_name | VARCHAR2(8) | ||||
gift_name | VARCHAR2(24) |
The collection that implements a list of eight character variable length strings should contain:
first
second
third
fourth
fifth
sixth
seventh
eighth
ninth
tenth
eleventh
twelfth
The collection of the object type should include the unique elements of the lyrics, like:
and a Partridge in a pear tree
Two and Turtle doves
Three and French hens
Four and Calling birds
Five and Golden rings
Six and Geese a laying
Seven and Swans a swimming
Eight and Maids a milking
Nine and Ladies dancing
Ten and Lords a leaping
Eleven and Pipers piping
Twelve and Drummers drumming
All other values are repetitive strings. They should be embedded inside calls to the put_line function calls of the dbms_output package. You should also note that the first day of Christmas is a capital A as opposed to and a when it is the first day of Christmas.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started