Question: Example PL/SQL code: DECLARE country_name VARCHAR2 (50); median_age NUMBER(6,2); BEGIN SELECT country_name, median_age INTO country_name, median_age FROM wf_countries WHERE country_name = 'United States of America';
Example PL/SQL code:
DECLARE
country_name VARCHAR2 (50);
median_age NUMBER(6,2);
BEGIN
SELECT country_name, median_age INTO country_name, median_age
FROM wf_countries
WHERE country_name = 'United States of America';
DBMS_OUTPUT.PUT_LINE(' The median age in '||country_name||' is '||median_age||'.');
END;
(See the above example )
- Write an anonymous block that uses a country id as input and prints the country name and region. Use the countries table. Execute your block three times using AR, AU, and BE.
- Write an anonymous block that uses a job id as input and prints the job title, maximum salary and minimum salary. Use the jobs table. Execute your block three times using AR AD_PRES, AD_VP, and AC_MGR.
(try using a normal scalar variable and using %Type attribute.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
