商品表:product
i. 产品ID:id
ii. 产品名称:name
iii. 产品规格型号:model要求 添加 商品,数量在100个以上。 产品名不能重复 id为主键
create table product
(
id number(4) primary key not null,
name varchar(30) not null,
model varchar(50))我这个oracle菜鸟,做给个详细代码,谢谢!
i. 产品ID:id
ii. 产品名称:name
iii. 产品规格型号:model要求 添加 商品,数量在100个以上。 产品名不能重复 id为主键
create table product
(
id number(4) primary key not null,
name varchar(30) not null,
model varchar(50))我这个oracle菜鸟,做给个详细代码,谢谢!
v_count number := 0;
begin
while v_count <= 100 loop
execute immediate
'insert into product values('||v_count||', ''goods'''||v_count||', ''xxx'')';
v_count := v_count + 1;
end loop;
end;
/
说起添加多行数据,谢谢shiyiwan大哥,嘿嘿