If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 db2api.lib missing

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-18-11, 11:19
Yury Markman Yury Markman is offline
Registered User
 
Join Date: May 2011
Posts: 8
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
Reply With Quote
  #2 (permalink)  
Old 05-18-11, 11:56
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Reply With Quote
  #3 (permalink)  
Old 05-19-11, 05:04
Yury Markman Yury Markman is offline
Registered User
 
Join Date: May 2011
Posts: 8
another related question

thank you very much for your help.
Reply With Quote
  #4 (permalink)  
Old 05-19-11, 06:36
Yury Markman Yury Markman is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 05-19-11, 08:39
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
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).
Reply With Quote
Reply

Tags
db2, server driver, sqlefrce

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On