Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE PACKAGE temp_pckg AS
- CURSOR users_counters IS (
- SELECT
- COUNT(users.id) AS Number_of_Users,
- country.country_name AS Country
- FROM
- users,
- users_city,
- city,
- country
- WHERE
- users.id = users_city.users_id AND
- users_city.city_id = city.id AND
- city.country_id = country.id
- GROUP BY country.country_name
- );
- FUNCTION convert_to_celsius(temperature NUMBER) RETURN NUMBER;
- FUNCTION convert_to_fahrenheit(temperature NUMBER) RETURN NUMBER;
- END temp_pckg;
- CREATE OR REPLACE PACKAGE BODY temp_pckg AS
- FUNCTION convert_to_celsius
- ( temperature IN NUMBER )
- RETURN NUMBER
- IS
- converted_temperature NUMBER;
- BEGIN
- converted_temperature := (temperature - 32) / 1.8;
- RETURN converted_temperature;
- END convert_to_celsius;
- FUNCTION convert_to_fahrenheit
- ( temperature IN NUMBER )
- RETURN NUMBER
- IS
- converted_temperature NUMBER;
- BEGIN
- converted_temperature := temperature * 1.8 + 32;
- RETURN converted_temperature;
- END convert_to_fahrenheit;
- END temp_pckg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement