ORACLE10标识符过长,在线等 5
declarel_stdidt_student.stdid%type;l_stdnamet_student.stdname%type;l_stdsext_student....
declare
l_stdid t_student.stdid%type;
l_stdname t_student.stdname%type;
l_stdsex t_student.stdsex%type;
l_stdgrade t_student.stdgrade%type;
l_stdscore t_stdscore.stdscore%type;
l_rand number(5) default 0;
begin
for j in 1..10000 loop
l_stdname:=";
l_rand:=floor(dbms_random.value(2,6));
for i in 1..l_rand loop
l_stdname:=l_stdname||chr(floor(dbms_random.value(45000,55000)));
end loop;
--获得性别
l_rand:=floor(dbms_random.value(1,5));
if l_rand mod 3 = 0 then
l_stdsex:='男';
else
l_stdsex:='女';
endif;
l_rand:=floor(dbms_random.value(1,8));
case l_rand
when 1 then l_stdgrade:='大一';
when 2 then l_stdgrade:='大二';
when 3 then l_stdgrade:='大三';
else l_stdgrade;='大四';
end case;
l_stdscore;=floor(dbms_random.value(0,100));
insert into t_student values(j,l_stdname,l_stdsex,l_stdgrade,l_stdscore);
if j mod 100=0 then
commit;
end if;
end loop;
commit;
end; 展开
l_stdid t_student.stdid%type;
l_stdname t_student.stdname%type;
l_stdsex t_student.stdsex%type;
l_stdgrade t_student.stdgrade%type;
l_stdscore t_stdscore.stdscore%type;
l_rand number(5) default 0;
begin
for j in 1..10000 loop
l_stdname:=";
l_rand:=floor(dbms_random.value(2,6));
for i in 1..l_rand loop
l_stdname:=l_stdname||chr(floor(dbms_random.value(45000,55000)));
end loop;
--获得性别
l_rand:=floor(dbms_random.value(1,5));
if l_rand mod 3 = 0 then
l_stdsex:='男';
else
l_stdsex:='女';
endif;
l_rand:=floor(dbms_random.value(1,8));
case l_rand
when 1 then l_stdgrade:='大一';
when 2 then l_stdgrade:='大二';
when 3 then l_stdgrade:='大三';
else l_stdgrade;='大四';
end case;
l_stdscore;=floor(dbms_random.value(0,100));
insert into t_student values(j,l_stdname,l_stdsex,l_stdgrade,l_stdscore);
if j mod 100=0 then
commit;
end if;
end loop;
commit;
end; 展开
展开全部
把标识符过长的字段的类型加长。
追问
就是不知道那些地方过长,可以帮我指出下么
追答
你运行下,看哪里报错,把错误信息,发出来
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询