MySQL上的Firebird EXECUTE BLOCK

时间:2015-06-04 15:50:21

标签: mysql sql block

如何在MySQL上使用Firebird 执行块语句?

execute block
as
declare i int = 0;
begin
  while (i < 128) do
  begin
    insert into AsciiTable values (:i, ascii_char(:i));
    i = i + 1;
  end
end

1 个答案:

答案 0 :(得分:0)

你在Firebird execute block中的意思是MySQL;如果是,那么将您发布的代码包装在下面的stored procedure中,这将完成工作

create procedure usp_test
as
begin
declare i int = 0;
  while (i < 128) do
  begin
    insert into AsciiTable values (:i, ascii_char(:i));
    i = i + 1;
  end
end