Write a PL/SQL block that includes declarations for the following variables: A v
ID: 652164 • Letter: W
Question
Write a PL/SQL block that includes declarations for the following variables:
A varchar2 datatype that can contain "ITM108 Intro to Databases and PLSQL"
a number that can be assigned 987654.55, but not 987654.567 nor 9876543.55
a constant (you choose the correct data type) that is auto-initialized to "Dave"
A boolean
A data data type autoinitialized to a month from the day you do this assignment.
In the body of the Pl/SQL block put a DBMS_output.put_line message for each of the variables that received an autoinitialization value.
In a comment at the bottom of the PL/SQL block, state the value of the number data type.
Explanation / Answer
DECLARE
title VARCHAR2(35);
num NUMBER(8,2);
author CONSTANT VARCHAR2(6) := "Dave";
boolValue BOOLEAN;
startDate DATE := TO_DATE ('11-1-2015','mm-dd-yyyy');
BEGIN
dbms_output.put_line('Author ' || author);
dbms_output.put_line('Assignment start date ' || startDate);
-- value of number data type is 987654.55
END;
/
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.