[已解决]新建mysql的存储过程报错,麻烦帮看看哪里不对
澳门新葡京官网
澳门新葡京官网
当前位置 : 澳门新葡京官网 > 新葡京娱乐场

[已解决]新建mysql的存储过程报错,麻烦帮看看哪里不对

mysql> delimiter //
mysql> create procedure rong
    -> begin
    -> select * from student;
    -> end //
ERROR 1064 42000: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near begin
select * from student;
end at line 2
mysql>
mysql> delimiter //
mysql> create procedure rong
    -> begin
    -> select * from student;
    -> end //
Query OK, 0 rows affected 0.00 sec

mysql存储过程批量插入数据

    ->delimiter //
    -> create procedure huan
    -> begin
    -> declare i int;
    -> set i=2;
    -> while i<100 do
    -> insert into studentid,name,sexvaluesi,huan,girl;
    -> set i=i+1;
    -> end while;
    -> end //
Query OK, 0 rows affected 0.00 sec

执行存储过程,插入数据
call huan

oracle存储过程批量插入数据

create or replace procedure rong
is
  i integer;
begin
  i := 1;
  loop
    insert into student_infoid,name,gender,describe,blogsitevaluesi,cuihuanhuan,girl,dddd,baidu.com;
    i := i + 1;
    exit when i > 100;
  end loop;
end;



不缩进也没事
exec rong;
commit;
这样就成功插入100条数据了

sqlserver存储过程批量插入数据

declare @i bigint;
set @i=1
while@i<=5000
begin
   insert into student_infoid,name,gender,comment,blogsitevalues@i,cuiuanhuan,girl,自卫,baidu.com
   set @i=@i+1
end

栏目列表

广告位

澳门新葡京官网