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 > C++ cli application

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #46 (permalink)  
Old 01-12-12, 02:08
irfanmaroof irfanmaroof is offline
Registered User
 
Join Date: Jan 2012
Posts: 53
stolze can you provide me a sample CLI program which can fetch records with better speed.

and with some statistics .if you have in your storage.
Reply With Quote
  #47 (permalink)  
Old 01-20-12, 01:27
irfanmaroof irfanmaroof is offline
Registered User
 
Join Date: Jan 2012
Posts: 53
Problem is because of LONG VARCHAR and LONG VARGRAPHIC data types. when i try to fetch data with other data types and data fetch rate is much better.

What is the problem with LONG VARCHAR and LONG VARGRAPHIC for fetching using DB2 CLI?
Reply With Quote
  #48 (permalink)  
Old 01-20-12, 04:51
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
First, LONG VARCHAR and LONG VARGRAPHIC have been deprecated (LONG VARCHAR and LONG VARGRAPHIC data types have been deprecated) for a long time already (since December 2006). As a consequence, any new features and performance improvements in DB2 are not likely to work at all or as good for those data types.

But back to your performance issue: LONG VARCHAR and LONG VARGRAPHIC are stored separately and won't benefit from the buffer pool. So all access to such values incurs disk I/O, which is simply... slow.

You can use VARCHAR instead of LONG VARCHAR. The difference of the maximum length is 32672 vs. 32700 bytes. Similar for VARGRAPHIC and LONG VARGRAPHIC, where you can store a mere 14 double-byte characters more in a LONG VARGRAPHIC. (SQL and XML limits) If you have longer strings than that, CLOB and DBCLOB are the way to go. But those values of those types won't benefit from the caching in the DB2 buffer pool either (except for inlined portions) - which means it will be slower to fetch them!
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #49 (permalink)  
Old 01-20-12, 05:06
irfanmaroof irfanmaroof is offline
Registered User
 
Join Date: Jan 2012
Posts: 53
Thanks a lot stolze..... Now i think this was the only problem and now i have its possible solution.I ll not use LONG VARCHAR and LONG VARGRAPHIC.
Reply With Quote
  #50 (permalink)  
Old 01-30-12, 04:14
irfanmaroof irfanmaroof is offline
Registered User
 
Join Date: Jan 2012
Posts: 53
Why we can't connect to remote DB2 database without configuring or adding that in IBM DB2 client in C++ application using CLI API?


with this error.

[IBM][CLI Driver] SQL1013N The database alias name or database name "UTF16_T" could not be found. SQLSTATE=42705


i can use database by adding database it in IBM DB2 client(Control Center).
Reply With Quote
  #51 (permalink)  
Old 01-31-12, 18:04
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The DB2 client is doing the network communication on behalf of the application using it. So if the DB2 client doesn't know which database to use and where it resides and at which port the database system can be reached, it can't connect to it.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Tags
c++\cli, db2 c++ application, db2 cli

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