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 > Can I set DB2CodePage with CLI or DB2 Api?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-05, 23:39
carmenlei carmenlei is offline
Registered User
 
Join Date: Jun 2004
Posts: 24
Can I set DB2CodePage with CLI or DB2 Api?

I've try to set DB2CodePage with command:
>db2set db2codepage=1386
and it is success.
But is there any function of CLI or DB2 api for me to set this variable?
Thanks in advance~
Reply With Quote
  #2 (permalink)  
Old 02-02-05, 00:28
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
Can you invoke db2set directly? something like
rc=db2set("db2set","db2codepage=1386");
And, if you didn't know it, I have a low level of C expertise. But this should give you the idea.

James Campbell
Reply With Quote
  #3 (permalink)  
Old 02-02-05, 01:19
carmenlei carmenlei is offline
Registered User
 
Join Date: Jun 2004
Posts: 24
Quote:
Originally Posted by jacampbell
Can you invoke db2set directly? something like
rc=db2set("db2set","db2codepage=1386");
And, if you didn't know it, I have a low level of C expertise. But this should give you the idea.

James Campbell
sorry, how to invoke db2set directly?
may u give me more details on it?
Is there any api that can connect/manage db2 and is lower level than db2 api?
Thanks very much~
Reply With Quote
  #4 (permalink)  
Old 02-02-05, 02:38
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Please search for db2set in the db2 documentation ...
Please try to make use of the pointers/references you are provided with and do not expect detailed 'how-to's ...

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 02-02-05, 02:40
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
BTW,if you didn't know where to find db2 documentation

http://publib.boulder.ibm.com/infoce...help/index.jsp
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #6 (permalink)  
Old 02-02-05, 11:51
Domano Domano is offline
Registered User
 
Join Date: Feb 2005
Posts: 1
Be carefull when dynamically changing the db2 code page. Don't forget that all your existing tables have been previously loaded with the previous hexadecimal representation of characters. Exemple, if before you were with
an IBM 297 code page where '@' = x'44' and now with an IBM 500 code page then all your previous '@' will appear as 'à'. When doing this kind of update it's wise to first unload all your tables that contains characters strings, then
change the default DB2 code page and then reload all your previously unloaded tables to be sure of their contents.
Dom.
Reply With Quote
  #7 (permalink)  
Old 02-02-05, 14:07
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by Domano
Be carefull when dynamically changing the db2 code page. Don't forget that all your existing tables have been previously loaded with the previous hexadecimal representation of characters. Exemple, if before you were with an IBM 297 code page where '@' = x'44' and now with an IBM 500 code page then all your previous '@' will appear as 'à'.
I don't think this is entirely correct. String data in the database are stored using the database codepage, which is specified at the database creation time and cannot be changed later.

"db2set db2codepage=..." is used to set the client codepage, so that DB2 client correctly translated strings from the database codepage into the client codepage.
Reply With Quote
Reply

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