1

如果我有一个存储过程,我做一个插入。

我想0 or 1根据插入操作是否成功返回。informix我想知道@@rowcount在 sql server 中是否有类似的东西?

如果可能,请举例。

4

2 回答 2

1

It seems you can use the following in a stored procedure to extract the rowcount.

if dbinfo('sqlca.sqlerrd2') = 0 then
   return 0;
else
   return 1;
end if;

(The syntax might be off; it's been years since I used Informix.)

于 2012-07-17T10:07:16.770 回答
0

在 Sql Server 中,当您实例化一个新的 SQlCommand 时,SqlCommand 对象的 ExecuteNonQuery() 方法返回受该命令影响的行数。我不知道在 informix 中是否也可以这样做,但您应该尝试使用 InformixCommand 而不是 SQlCommand 并进行验证。

于 2012-07-17T10:11:04.373 回答