当前位置:首页 » 存储配置 » 调用存储过程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-07-04 21:01:57 浏览:761
存储服务器的硬盘如何格式化 发布:2025-07-04 20:59:54 浏览:113
联想服务器的bmc叫什么 发布:2025-07-04 20:52:29 浏览:817
三星手机如何建文件夹 发布:2025-07-04 20:42:34 浏览:475
苹果11的摄像头是什么配置 发布:2025-07-04 20:32:20 浏览:59
plc编程入门视频 发布:2025-07-04 20:26:02 浏览:927
小米电视设置界面密码是多少 发布:2025-07-04 20:26:01 浏览:989
linux软件测试 发布:2025-07-04 20:12:40 浏览:274
小数加减法计算法则 发布:2025-07-04 20:11:49 浏览:691
文件如何定时上传至服务器 发布:2025-07-04 20:06:17 浏览:861