I have the following code:
begin
for i in 1..2 loop
insert into dba_xy.despatch
select desp_id_seq.nextval,
dbms_random.string('U',5),
trunc(dbms_random.value(0000,9999)),
prod_id from dba_xy.product
prod_name from dba_xy.product;
end loop;
end;
When I ran it, the oracle gave me the following error message:
prod_name from dba_xy.product;
*
ERROR on line 8: ORA-06550: line 8, column 29: PL / SQL: ORA-00933: SQL command not completed correctly ORA-06550: line 3, column 2: PL / SQL: SQL expression is ignored
, , prod_id prod_name , . prod_name prod_id . prod_name , , prod_name .., prod_id, . , , , prod_id .
, .
prod_id :
begin
for i in 1..2 loop
insert into dba_xy.despatch
select desp_id_seq.nextval,
dbms_random.string('U',5),
trunc(dbms_random.value(0000,9999)),
prod_name from dba_xy.product;
end loop;
;
/
:
*
1:
ORA-00001: (DBA_XY.PROD_NAME_UC)
ORA-06512: 3