Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*13*/
- DECLARE
- v_countryid locations.country_id%TYPE := 'CA';
- v_loc_id locations.location_id%TYPE;
- v_counter NUMBER(2) :=1;
- v_new_city locations.city%TYPE := 'Montreal';
- BEGIN
- SELECT MAX(location_id) INTO v_loc_id FROM locations
- WHERE country_id=v_countryid;
- WHILE v_counter <= 3 loop
- INSERT INTO locations (location_id, city, country_id)
- VALUES ((v_loc_id + v_counter), v_new_city, v_countryid);
- v_counter := v_counter +1;
- END LOOP;
- COMMIT;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement