I have about 15 different Tables filled with different data and different entity relationships.
I need to create a script which will populate my database with the conten
Firstly, the package posted doesn't compile without errors.
You would need to fix the following first:
FOR LOOP
statements with END LOOP
BEGIN
of procedures with END
LOCATION
the column name and PL/SQL variable with the same name. Oracle cannot resolve which is to be used where in the INSERT]To get you started, I have fixed the fill_location
procedure below. Proceed similarly for the other procedure.
create or replace package body apartment as
procedure fill_location(location_number number) is
p_location_name varchar2(20);
p_postcode number(10,2);
begin
for num in 1.. location_number loop
p_location_name := 'location';
p_postcode := dbms_random.value(1000,9600);
p_location_name := p_location_name ||' '|| to_char(num);
insert into location (id_location, location_name, postcode)
values (num, p_location_name, p_postcode);
dbms_output.put_line(num);
end loop;
end fill_location;
Fix the above errors/suggestions until you get 'PL/SQL successfully compiled`. If you get 'compiled with errors' use "show errors" to find and fix any other errors.