Author |
Message
|
Seires |
Posted: Wed Mar 28, 2007 6:00 am Post subject: Multiple databases and encodings |
|
|
Newbie
Joined: 28 Mar 2007 Posts: 3
|
Hi all,
I've faced a problem with Message Broker v6:
How to configure Message Broker if I need to get data from two different encoding(non-Unicode) databases within the same message flow?
I've found that such environment variables as MQSI_LOCAL_CCSID, LC_ALL and LANG can help in case of a single database, but what if there are two or more?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 28, 2007 2:10 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Check out the possible ns_lang attributes of the driver. Perhaps it will support some ODBC settings... _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 28, 2007 2:19 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think the purpose of the env variables is to help Broker translate from whatever language/code set the database data is in, into Unicode...
So making sure that they are set to the correct values for the actual broker environment will ensure that they should work (as well as they can for each particular conversion) for databases running in any other codepage. But if there isn't a valid conversion between the two code pages (broker and one db) then only that db will be affected. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Seires |
Posted: Thu Mar 29, 2007 5:58 am Post subject: |
|
|
Newbie
Joined: 28 Mar 2007 Posts: 3
|
jefflowrey wrote: |
I think the purpose of the env variables is to help Broker translate from whatever language/code set the database data is in, into Unicode...
So making sure that they are set to the correct values for the actual broker environment will ensure that they should work (as well as they can for each particular conversion) for databases running in any other codepage. But if there isn't a valid conversion between the two code pages (broker and one db) then only that db will be affected. |
In my case I have two databases with different encodings. So I should let Broker to know somehow that ODBC source A has ccsid=1251 and source B has cssid=1252. The env variables allow only one global translation(1251 or 1252) to be set, thus I doubt that I can use them.
I'm not very advanced in ODBC and I don't know if ODBC connections provide any information about database encoding, but that could be the place to specify encoding for each connection. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 29, 2007 3:33 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No.
I think you need to tell Broker what it's "local" codepage is, which can be anything you want.
This is what the environment variables do.
Then, ODBC and the ODBC drivers will see that the remote database is running under a different codepage, and use the necessary conversion tables to change the data in the remote codepage into the local codepage.
See? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Seires |
Posted: Wed Apr 18, 2007 3:22 am Post subject: |
|
|
Newbie
Joined: 28 Mar 2007 Posts: 3
|
jefflowrey wrote: |
No.
I think you need to tell Broker what it's "local" codepage is, which can be anything you want.
This is what the environment variables do.
Then, ODBC and the ODBC drivers will see that the remote database is running under a different codepage, and use the necessary conversion tables to change the data in the remote codepage into the local codepage.
See? |
Not really
UCS-2 is used in Broker for the internal data. So if the database encoding could be sorted out via ODBC, then Broker should know which conversion tables should be applied. Why Broker should know about any local codepages if all what it needs to do is conversion from UCS-2 to the remote db encoding and back again? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 18, 2007 2:40 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
UCS-2 is used in Broker for the internal data. So if the database encoding could be sorted out via ODBC, then Broker should know which conversion tables should be applied. Why Broker should know about any local codepages if all what it needs to do is conversion from UCS-2 to the remote db encoding and back again? |
Because the odbc call is being made against the local os and it's char set.
The odbc call recognizes that and sets conversions in consequence. So the Broker must pickup/send in the local charset....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|