我要生成的带有单词的表
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代码
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;
/
除此 select 语句外,一切正常
SELECT w.word INTO streetaddress FROM words w ORDER BY dbms_random.random limit 1;
我收到这个错误
ORA-06550:第 10 行,第 75 列:PL/SQL:ORA-00933:SQL 命令未正确结束
我认为限制可能是问题......?