ITPub博客

首页 > 数据库 > > 使用命令行访问LinkoopDB 3: 创建存储过程或函数

使用命令行访问LinkoopDB 3: 创建存储过程或函数

作者:LCR_ 时间:2022-03-30 11:27:11 0 删除 编辑

在命令行创建存储过程或函数,需先输入.后,再编写存储过程或函数的具体内容,命令如下所示:

sql> \. 
Enter RAW SQL. No \, :, * commands. 
End with a line containing only ".;" to send to database, 
or only "." to store to edit buffer for editing or saving. ----------------------------------------------------------------------- 
raw> create procedure Sample_drs (inout drsnum integer) 
modifies sql data dynamic result sets 2 
begin atomic 
declare curd1 cursor 
for select * from drs1; 
declare curd2 cursor 
for select * from drs2 where drs2.a > drsnum; 
set drsnum = drsnum +1; 
open curd1;
open curd2; 
end;

存储过程或函数编写完成后,按下回车键,输入.;即可。

raw> .; 

took 23 ms. 

sql>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70000523/viewspace-3138796/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2022-02-22

  • 博文量
    1402
  • 访问量
    14973