Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2016
    Posts
    1

    Unanswered: db2 bulk load CLI0125E function Sequence Error

    Hi,

    I am using DB2 version 9.07.

    I have a simple SAS program, it creates a database table from existing table/dataset.
    If insertbuff=2, it works as expected and creates database table.

    libname work db2 user password datasrc='mydb' bulkload=yes insertbuff=2;

    libname dolly 'd:\temp';

    data work.bulkoad;
    set dolly.bulkload;
    run;

    The ODBC function sequence is as follows

    SqlAllocHandle(); // allocate environment handle
    SqlSetEnvAttr(); // set ODBC version
    SqlAllocHandle(); // allocate connection handle

    SqlDriverConnect() // connect through SqlDriverConnect()

    STMT_CREATE request
    Preparing Sql statement: create table work.bulkload(id number);
    STMT_PREPARE request
    posting SUCCESS
    STMT_EXECUTE request
    posting SUCCESS
    commit Request
    posting SUCCESS

    STMT_CREATE request
    Preparing Sql statement: INSERT INTO work.bulkload("id") values (?);
    STMT_PREPARE request
    posting SUCCESS

    SQLSetStmtAttr() // for SQL_ATTR_PARAM_BIND_TYPE, SQL_PARAM_BIND_BY_COLUMN
    SQLSetStmtAttr() // SQL_ATTR_PARAMSET_SIZE
    SQLSetStmtAttr() // SQL_ATTR_PARAM_STATUS_PTR
    SQLSetStmtAttr() // SQL_ATTR_PARAMS_PROCESSED_PTR

    STMT_BIND_INSERT
    SQLBindParameter()
    posting SUCCESS

    However if insertbuff=1, it fails at
    SQLBindParameter()
    [IBM][CLI Driver] CLI0125E Function sequence error SQLSTATE = HY010
    failed to bind parameters for an insert statement

    When insertbuff=1, i tried with and without setting above SQLSetStmtAttr() but result reamains same.
    Could you please help me in resolving the problem when insertbuff=1.

  2. #2
    Join Date
    Apr 2012
    Posts
    1,006
    Provided Answers: 16
    Post the output of the db2level command on the DB2-server *and* on the machine where the SAS attempts the load if that is different from the DB2 server.
    Issues like this can often result from downlevel drivers, or downlevel fixpacks. Although they can also result from application errors (in this case whatever SAS is doing under the covers).

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •