Home >Database >Mysql Tutorial >DB2数据库之命令行执行存储过程(以

DB2数据库之命令行执行存储过程(以

WBOY
WBOYOriginal
2016-06-07 15:44:013333browse

DB2数据中会用到存储过程,有的时候不能用客户端,需要在命令行中执行;下面是以@为结束符的存储过程。 方法1: [db2inst1@DB ~]$ db2 connect to jf user db2inst1 using db2inst1 [db2inst1@DB ~]$ db2 -td@ [db2inst1@DB ~]$ 复制存储过程 OK 方法2: [db

DB2数据中会用到存储过程,有的时候不能用客户端,需要在命令行中执行;下面是以@为结束符的存储过程。

方法1:

[db2inst1@DB ~]$ db2 connect to jf user db2inst1 using db2inst1

[db2inst1@DB ~]$ db2 -td@

[db2inst1@DB ~]$ 复制存储过程

OK

方法2:

[db2inst1@DB ~]$ cd /home/db2inst1

[db2inst1@DB ~]$ pwd

/home/db2inst1

[db2inst1@DB ~]$ db2 connect to jf user db2inst1 using db2inst1

[db2inst1@DB ~]$ db2 -td@  -vf  procedure.sql

OK

注:存储过程文件procedure.sql上传到/home/db2inst1/下面

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn