应该有个类似sqlgls()的函数,能够返回宿主变量的值,有谁知道吗?

解决方案 »

  1.   

    在oracle中写成一个过程,在pl/sql中作出错处理,然后调用过程,返回错误
      

  2.   

    能不能给些提示,我不知道如何做。
    sqlgls()函数的作用就是把出错的(可能是最后执行的)EXEC SQL语句返回,但是语句中的宿主变量却不能返回值,(一般是b0,b1,b2)代替了,我现在就是想在这时候,把宿主变量的值输出出来,应该有各类似sqlgls()的返回函数。真的没有人知道吗? 有谁知道sqlgls()函数具体是如何写,定义的也可以,能不能告诉我?十分感谢
      

  3.   

    void sqlgls( char*, size_t*, size_t* );
      

  4.   

    Full Text of Error Messages
    void sqlglm(char *message_buffer,size_t *buffer_size,size_t *message_length);message_buffer Is the text buffer in which you want Oracle to store the error
    message (Oracle blank-pads to the end of this buffer).buffer_size Is a scalar variable that specifies the maximum size of the buffer in bytes.
    message_length Is a scalar variable in which Oracle stores the actual length of the error message, if not truncated.The SQLStmtGetText() function (old name:sqlgls() function)
    void SQLStmtGetText(dvoid *context, char *sqlstm, size_t *stmlen, size_t
    *sqlfc);
    The context parameter is the runtime context. For definition and use of contexts, see
    "CONTEXT Variables" on page 4-36.
    The sqlstm parameter is a character buffer that holds the returned text of the SQL
    statement. Your program must statically declare the buffer or dynamically allocate
    memory for the buffer.
    The stmlen parameter is a size_t variable. Before calling SQLStmtGetText(), set this
    parameter to the actual size, in bytes, of the sqlstm buffer. WhenSQLStmtGetText()
    returns, the sqlstm buffer contains the SQL statement text, blank padded to the
    length of the buffer. The stmlen parameter returns the actual number of bytes in the
    returned statement text, not counting blank padding. The maximum value of stmlen
    is port-specific and generally will be the maximum integer size.
    The sqlfc parameter is a size_t variable that returns the SQL function code for the
    SQL command in the statement. Table 9–3 shows the SQL function codes for the
    commands.
      

  5.   

    sqlglm是获得完整出错信息的函数,多线程版本sqlglmt(dvoid *context,char *message_buffer,size_t *buffer_size,size_t *message_length)
    SQLStmtGetText()是用来获取出错的的SQL的(老版本的名字叫sqlgls())
      

  6.   

    http://ovir.icp.ac.ru/oracle/doc/api/doc/pc_22/ch09.htm#err-sqlgls
    http://ovir.icp.ac.ru/oracle/doc/api/doc/pc_22/ch09.htm#err-sqlglm这两个地方有你所要的解释,不过是英文的!
      

  7.   

    先谢过楼上老兄,您的资料讲的是sqlgls的含义用法,我想知道的是函数的具体如何用c写的,是如何把c中存有sql语句的结构体返回的?应该怎样找呢?
      

  8.   

    我其实就是想仿照sqlgls(),写一个能够返回宿主变量的东西