Table with word I want to generate
create table words
( word varchar(100));
insert into words values ('Main street');
insert into words values ('Patrick Street');
insert into words values ('Red Street');
insert into words values ('Green street');
insert into words values ('Blue street');
insert into words values ('Yellow street');
insert into words values ('Silver street');
insert into words values ('Gold street');
insert into words values ('Brown street');
PLSQL code for insert
declare
randTemp number(10);
tempCounty VARCHAR(20);
streetaddress VARCHAR(100);
Begin
For i in 1..9
Loop
randTemp := dbms_random.value(1,5);
SELECT c.countyname INTO tempCounty FROM county C WHERE c.countyid = randTemp;
SELECT w.word INTO streetaddress FROM words w ORDER BY dbms_random.random limit 1;
Insert into BRANCH values(i,streetaddress,tempCounty,randTemp);
End loop;
Commit;
End;
/
Everything works besides this select statement
SELECT w.word INTO streetaddress FROM words w ORDER BY dbms_random.random limit 1;
I get this error
ORA-06550: line 10, column 75: PL/SQL: ORA-00933: SQL command not properly ended
I think the limit might be the problem...???