当前位置:首页 » 存储配置 » 调用存储过程db2

调用存储过程db2

发布时间: 2025-01-07 18:08:23

A. 在C#NET中怎样调用db2存储过程

1、找开sql server 2005,创建表名为abc的表,表的设计如图。 2、给表中加入三行数据,如图。 3、创建一个名为“pro_abc”的存储过程,内容如图。 4、在程序中的配置文件,配置数据库链接字符串,如图。

B. db2 调用存储过程,报错:SQL1646N 无法访问sqllib

帮一下包试试?
db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\db2schema.bnd BLOCKING ALL GRANT PUBLIC SQLERROR CONTINUE
db2 BIND path\@db2ubind.lst BLOCKING ALL GRANT PUBLIC ACTION ADD
db2 BIND path\@db2cli.lst BLOCKING ALL GRANT PUBLIC ACTION ADD
db2 terminate

where dbname represents the name of a database to which the files should be bound, and where path is the full path name of the directory where the bind files are located, such as INSTHOME\sqllib\bnd where INSTHOME represents the home directory of the DB2 instance. db2ubind.lst and db2cli.lst contain lists of required bind files used by DB2 database procts. Packages that are already bound will return an SQL0719N error. This is expected.

C. DB2存储过程

db2 -td@ -vf a.db2
这一句中@的意思是读取文件中的分隔,每遇到一个@号会将之前的SQL语句做为单独一段来执行,你的存储过程中有使用了这个符号,则执行时将创建存储过程的语句给分拆开了,所以执行会同语法错误,你这一段中只需要两个@号,第一句连接数据库后用一个,最后用一个,中间的改成“;”号。

connect to toolsdb@
CREATE PROCEDURE testProced(
in in_name varchar(20),
out out_name varchar(20)
)
LANGUAGE SQL

BEGIN
select a into out_name from bb where a1 = in_name;
END@

热点内容
怎么学习使用服务器 发布:2025-05-10 09:22:59 浏览:506
ftp服务器怎么搭建多个目录 发布:2025-05-10 09:08:09 浏览:580
数空车床编程 发布:2025-05-10 08:48:48 浏览:91
脚本禁英雄 发布:2025-05-10 08:46:47 浏览:431
plc编程软件gxdeveloper 发布:2025-05-10 08:43:46 浏览:874
沼气压缩 发布:2025-05-10 08:38:40 浏览:272
阿里云服务器centos 发布:2025-05-10 08:37:14 浏览:247
安卓手机配什么收音麦 发布:2025-05-10 08:33:37 浏览:374
安卓手机如何边玩游戏边视频 发布:2025-05-10 08:30:27 浏览:194
在哪里观看登录密码 发布:2025-05-10 08:28:50 浏览:213