`
sogo6
  • 浏览: 115464 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

PROCEDURE can't return a result set in the given context

阅读更多
调用存储过程失败!出现如下错误:

    PROCEDURE ipbx.qu_ery can't return a result set in the given context.

    ipbx是数据库

    qu_ery是自己写的存储过程的名字


原因:连接数据库的方式不正确。

导致报错的连接方式:

if(!mysql_real_connect(&mysql,"localhost","root","123456",
    "ipbx",0,NULL,0))
{
    printf("mysql_real_connect() failed!/n");
    mysql_close(&mysql);
    return 0;
}


正确的连接方式:             
if(!mysql_real_connect(&mysql,"localhost","root","123456",
    "ipbx",0,NULL,CLIENT_MULTI_STATEMENTS))
{
    printf("mysql_real_connect() failed!/n");
    mysql_close(&mysql);
    return 0;
}

修改一下连接数据库的方式的参数就OK了!
分享到:
评论

相关推荐

    微软内部资料-SQL性能优化3

    To make use of either more or less strict isolation levels in applications, locking can be customized for an entire session by setting the isolation level of the session with the SET TRANSACTION ...

    微软内部资料-SQL性能优化2

    Assuming the page reference does not result in an access violation, a page fault can be either hard or soft. A hard page fault results in a read from disk, either a page file or memory-mapped file. A...

    Delphi7.1 Update

    * Using a TDBLookupComboBox to display a list of data given by a detail TQuery results in the error "Field ‘‘ not found" (Quality Central 5384 and 4823). * TDBRadioGroup maintains its ...

    ora分析脚本

    -o [graphfile] to store the result in a file instead of displaying it -m [min_size] only consider workareas with a minimum size - pgaadvhist [-f []] display the advice history for all factors or ...

    MySQL5创建存储过程的示例

    使用旧的mysql扩展尝试获取多个结果集时,会出现“can't return a result set in the given context”这样的错误。因此,推荐在PHP中使用mysqli或PDO扩展来充分利用MySQL5的存储过程功能。 mysqli扩展提供了更丰富...

    php调用mysql存储过程

    调用带有select语句的存储过程就出现 PROCEDURE p can’t return a result set in the given context的错误。google了半天,在mysql官网上找到一些说法,db_mysql的模块不支持存储过程调用,解决方法是...

Global site tag (gtag.js) - Google Analytics