Results 1 to 5 of 5
  1. #1
    Join Date
    May 2011
    Posts
    8

    Unanswered: db2 db2api.lib missing

    hello
    I need to call FORCE APPLICATION from my C/C++ code.
    The conventional way is to call sqlefrce() function which is declared in sqlenv.h file.
    The problem is that the function's object code sits is db2api.lib which is missing from all the client installations. I tried IBM Data Server Driver for ODBC and CLI, IBM Data Server Driver Package, IBM Data Server Runtime Client on Windows. None of the contains this lib. It is rpesent only in the server installation.
    If I try to call FORCE APPLICATION using conventinal CLI interface (calling SQLExecDirect()), I got an error like

    [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "APPLICATION" was found following "FORCE ". Expected tokens may include: "JOIN <joined_table>". SQLSTATE=42601

    please tell me if I can call force application using client software only, without copying db2api.lib from server distribution


    thanks
    Yury Markman

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

  3. #3
    Join Date
    May 2011
    Posts
    8

    another related question

    thank you very much for your help.

  4. #4
    Join Date
    May 2011
    Posts
    8

    connect to DB

    can I run SYSPROC.ADMIN_CMD() without prior connection to a database? the problem that SQLExecDirect() I use for this call, requires prior call of SQLConnect() to get the connection handle for the SQL call. On the other hand, when I call FORCE APPLICATION from db2 command line, I do not need to connect to a database

    thanks
    Yury

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Clearly you must be connected to a database in order to execute any SQL statement, including a call to a stored procedure. FORCE APPLICATION is not an SQL statement, it is a CLP command, and as such it does not need a database connection (it requires an instance attachment though, which is done implicitly by CLP).

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
  •