Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2004
    Posts
    24

    Unanswered: 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~

  2. #2
    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

  3. #3
    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~

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  6. #6
    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.

  7. #7
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

Posting Permissions

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