Character set mismatch in copying from oracle to oracle
I have a set of ODI scripts that are copying from a source JD Edwards ERP database (Oracle 10g) to a BI datamart (Oracle 10g) and all the original scripts work OK.
However I have mapped on to some additional tables in the ERP source database and some new BI tables in the target datamart database (oracle - to - oracle) but get an error when I try ro execute these.
The operator log shows that the error is in the 'INSERT FLOW INTO I$ TABLE' and the error is ORA-12704 character set mismatch.
The character set for both Oracle databases are the same (and have not changed) the main NLS_CHARACTERSET is AL332UTF8 and the national NLS_NCHAR_CHARACTERSET is AL16UTF16.
But this works for tables containing NCHAR and NUMBER in previous scripts but not for anything I write now.
The only other difference is that there was a recent upgrade of ODI to 10.1.3.5 - the repositories are also upgraded.
Any ideas ?
Hi Ravi,
yes, a gateway would help. In 11.2 Oracle offers 2 kind of gateways to a SQL Server - a gateway for free which is based on 3rd party ODBC drivers (you need to get them from a 3rd party vendor, they are not included in the package) and called Database Gateway for ODBC (=DG4ODBC) and a very powerful Database Gateway for MS SQL Server (=DG4MSQL) which allows you also to execute distributed transactions and call remote SQL Server stored procdures. Please keep in mind that DG4MSQL requires a separate license.
As you didn't post which platform you're going to use, please check out On "My Oracle Support" (=MOS) where you'll find notes how to configure each gateway for all supported platforms - just look for DG4MSQL or DG4ODBC
On OTN you'll find the also the manuals.
DG4ODBC: http://download.oracle.com/docs/cd/E11882_01/gateways.112/e12070.pdf
DG4MSQL: http://download.oracle.com/docs/cd/E11882_01/gateways.112/e12069.pdf
The generic gateway installation for Unix: http://download.oracle.com/docs/cd/E11882_01/gateways.112/e12013.pdf
and for Windows: http://download.oracle.com/docs/cd/E11882_01/gateways.112/e12061.pdf
Similar Messages
-
Migration from 9i to 11g Transparent Gateway results in a) ORA-12704: character set mismatch b) ORA-02070: database ... does not support SYS_OP_C2C in this context
What Transparent Gateway (TG) 11g configuration steps prevent the following errors?:
a) ORA-12704: character set mismatch
b) ORA-02070: database <DB_link_name> does not support SYS_OP_C2C in this context
Hints:
The current 9i TG works with the existing views and packages. These same db objects will not compile using the new 11g TG.
The db objects are on an Oracle 10g database linked to an SQL Server 2008 R2 database.
Since the 9i TG works I assume a configuration to the 11g TG will get it working same as before. But what...
Is is something controlled by these parameters? (Sorry, I don't know how this stuff works. I'm the application developer. My DBAs setup the Transparent Gateways.):
Parameters in the Gateway Startup Shell script:
ORA_NLS33
NLS_LANG
Parameters in the initsid.ora file:
HS_LANGUAGE
HS_NLS_DATE_FORMAT
HS_NLS_DATE_LANGUAGE
I'm avoiding the known workaround to refactor the VIEWS and PACKAGES to contain CAST() statements to explicitly match the data types. A server side fix to the 11g TG is preferred.
Sample code:
a) ORA-12704: character set mismatch
... is caused by SQL that works with my 9i TG but not with my 11g TG. It's a snippit from my view that won't compile:
select status_code -- Oracle VARCHAR2(30)
from ora_app_interfaces
UNION
select "StatusCode" as status_code -- SQL Server NVARCHAR(30)
from SqlAppInterfaces
Example workaround that I'm avoiding:
select status_code
from ora_app_interfaces
UNION
select CAST("StatusCode" as VARCHAR(30)) as status_code
from SqlAppInterfaces
b) ORA-02070: database <DB_link_name> does not support SYS_OP_C2C in this context
A line of code in the procedure that compiles correctly but fails to execute:
-- Insert into SQL Server from Oracle
insert into PatientMedRecNum (
"PatID", -- SQL Server INT
"MedRecNum", -- SQL Server NVARCHAR(11)
"Hospital") -- SQL Server NVARCHAR(30)
values (
pi_pat_id, -- Oracle NUMBER
pi_med_rec_num, -- Oracle VARCHAR2
pi_hospital); -- Oracle VARCHAR2
I'd guess the errors are caused by the TG's implicit conversion between the Oracle VARCHAR2 and the SQL Server NVARCHAR... but this works fine on the 9i TG... how do I set it up to work on the 11g TG?
Thanks!Trace of 11g TG... generating errors due to lack of automatic mapping from SQL NVARCHAR to Oracle NVARCHAR, where the previous 9g TG mapped from SQL NVARCHAR to Oracle VARCHAR2.
Oracle Corporation --- MONDAY SEP 22 2014 13:35:08.186
Heterogeneous Agent Release
11.2.0.4.0
Oracle Corporation --- MONDAY SEP 22 2014 13:35:08.186
Version 11.2.0.4.0
Entered hgogprd
HOSGIP for "HS_FDS_TRACE_LEVEL" returned "DEBUG"
Entered hgosdip
setting HS_OPEN_CURSORS to default of 50
setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"
setting HS_FDS_RECOVERY_PWD to default value
setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG
setting HS_IDLE_TIMEOUT to default of 0
setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"
setting HS_NLS_NCHAR to default of "UCS2"
setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"
setting HS_FDS_DATE_MAPPING to default of "DATE"
setting HS_RPC_FETCH_REBLOCKING to default of "ON"
setting HS_FDS_FETCH_ROWS to default of "100"
setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"
setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"
setting HS_FDS_PROC_IS_FUNC to default of "FALSE"
setting HS_FDS_MAP_NCHAR to default of "TRUE"
setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"
setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"
setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"
setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"
setting HS_FDS_QUERY_DRIVER to default of "FALSE"
setting HS_FDS_SUPPORT_STATISTICS to default of "TRUE"
setting HS_FDS_QUOTE_IDENTIFIER to default of "TRUE"
setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"
setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"
setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"
setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLStatistics;gtw$:SQLGetInfo"
setting HS_FDS_DELAYED_OPEN to default of "TRUE"
setting HS_FDS_WORKAROUNDS to default of "0"
setting HS_FDS_ARRAY_EXEC to default of "TRUE"
Exiting hgosdip, rc=0
ORACLE_SID is "xxxDEV"
Product-Info:
Port Rls/Upd:4/0 PrdStat:0
Agent:Oracle Database Gateway for MSSQL
Facility:hsa
Class:MSSQL, ClassVsn:11.2.0.4.0_0019, Instance:xxxDEV
Exiting hgogprd, rc=0
Entered hgoinit
HOCXU_COMP_CSET=1
HOCXU_DRV_CSET=178
HOCXU_DRV_NCHAR=1000
HOCXU_DB_CSET=178
HS_LANGUAGE not specified
rc=1239980 attempting to get LANG environment variable.
HOCXU_SEM_VER=102000
Entered hgolofn at 2014/09/22-13:35:08
RC=-1 from HOSGIP for "PATH"
Setting PATH to "C:\oracle\product\11.2.0\tg_2\dg4msql\driver\lib"
Exiting hgolofn, rc=0 at 2014/09/22-13:35:08
HOSGIP for "HS_OPEN_CURSORS" returned "50"
HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
treat_SQLLEN_as_compiled = 1
Exiting hgoinit, rc=0 at 2014/09/22-13:35:08
Entered hgolgon at 2014/09/22-13:35:08
reco:0, name:abaccess, tflag:0
Entered hgosuec at 2014/09/22-13:35:08
uencoding=UTF16
Entered shgosuec at 2014/09/22-13:35:08
Exiting shgosuec, rc=0 at 2014/09/22-13:35:08
shgosuec() returned rc=0
Exiting hgosuec, rc=0 at 2014/09/22-13:35:08
HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
HOSGIP for "HS_FDS_DEFAULT_OWNER" returned "dbo"
HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
Entered hgocont at 2014/09/22-13:35:08
HS_FDS_CONNECT_INFO = "sqlserverxxx/sqlinstancexxx/SQL_Server_2008_xxx_DEV"
RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"
Entered hgogenconstr at 2014/09/22-13:35:08
dsn: sqlserverxxx/sqlinstancexxx/SQL_Server_2008_xxx_DEV, name:xxx_admin
optn:
Entered hgocip at 2014/09/22-13:35:08
dsn:sqlserverxxx/sqlinstancexxx/SQL_Server_2008_xxx_DEV
Exiting hgocip, rc=0 at 2014/09/22-13:35:08
Entered shgogohn at 2014/09/22-13:35:08
ohn is 'OraGtw11g_home2'
Exiting shgogohn, rc=0 at 2014/09/22-13:35:08
RC=-1 from HOSGIP for "HS_FDS_ENCRYPT_SESSION"
using 0 as default value for "HS_FDS_ENCRYPT_SESSION"
RC=-1 from HOSGIP for "HS_FDS_VALIDATE_SERVER_CERT"
using 1 as default value for "HS_FDS_VALIDATE_SERVER_CERT"
Entered hgocont_OracleCsidToIANA at 2014/09/22-13:35:08
Returning 2252
Exiting hgocont_OracleCsidToIANA at 2014/09/22-13:35:08
Exiting hgogenconstr, rc=0 at 2014/09/22-13:35:08
Entered hgopoer at 2014/09/22-13:35:08
hgopoer, line 231: got native error 5701 and sqlstate 01000; message follows...
[Oracle][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Changed database context to 'Xxx_XXX_DEV'. {01000,NativeErr = 5701}[Oracle][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Changed language setting to us_english. {01000,NativeErr = 5703}
Exiting hgopoer, rc=0 at 2014/09/22-13:35:08
hgocont, line 2764: calling SqlDriverConnect got sqlstate 01000
Entered hgolosf at 2014/09/22-13:35:08
Exiting hgolosf, rc=0 at 2014/09/22-13:35:08
DriverName:HGmsss23.dll, DriverVer:07.01.0093 (B0098, U0065)
DBMS Name:Microsoft SQL Server, DBMS Version:10.00.2531
Exiting hgocont, rc=0 at 2014/09/22-13:35:08 with error ptr FILE:hgocont.c LINE:2764 ID:SQLDriverConnect
SQLGetInfo returns Y for SQL_CATALOG_NAME
SQLGetInfo returns 128 for SQL_MAX_CATALOG_NAME_LEN
Exiting hgolgon, rc=0 at 2014/09/22-13:35:08
Entered hgoulcp at 2014/09/22-13:35:08
Entered hgowlst at 2014/09/22-13:35:08
Exiting hgowlst, rc=1 at 2014/09/22-13:35:08
SQLGetInfo returns Y for SQL_PROCEDURES
SQLGetInfo returns 0x1f for SQL_OWNER_USAGE
TXN Capable:2, Isolation Option:0xf
SQLGetInfo returns 128 for SQL_MAX_SCHEMA_NAME_LEN
SQLGetInfo returns 128 for SQL_MAX_TABLE_NAME_LEN
SQLGetInfo returns 134 for SQL_MAX_PROCEDURE_NAME_LEN
HOSGIP returned value of "TRUE" for HS_FDS_QUOTE_IDENTIFIER
SQLGetInfo returns " (0x22) for SQL_IDENTIFIER_QUOTE_CHAR
13 instance capabilities will be uploaded
capno:1992, context:0x0001ffff, add-info: 0
capno:3042, context:0x00000000, add-info: 0, translation:"42"
capno:3047, context:0x00000000, add-info: 0, translation:"57"
capno:3049, context:0x00000000, add-info: 0, translation:"59"
capno:3050, context:0x00000000, add-info: 0, translation:"60"
capno:3066, context:0x00000000, add-info: 0
capno:3067, context:0x00000000, add-info: 0
capno:3068, context:0x00000000, add-info: 0
capno:3069, context:0x00000000, add-info: 0
capno:3500, context:0x00000001, add-info: 91, translation:"42"
capno:3501, context:0x00000001, add-info: 93, translation:"57"
capno:3502, context:0x00000001, add-info: 107, translation:"59"
capno:3503, context:0x00000001, add-info: 110, translation:"60"
Exiting hgoulcp, rc=0 at 2014/09/22-13:35:08
Entered hgouldt at 2014/09/22-13:35:08
NO instance DD translations were uploaded
Exiting hgouldt, rc=0 at 2014/09/22-13:35:08
Entered hgobegn at 2014/09/22-13:35:08
tflag:0 , initial:1
hoi:0x12ee18, ttid (len 32) is ...
xxx
xxx
tbid (len 10) is ...
0: 09000F00 0FAC1E00 010A [..........]
Exiting hgobegn, rc=0 at 2014/09/22-13:35:08
Entered hgodtab at 2014/09/22-13:35:08
count:1
table: XXX_INTERFACE
Allocate hoada[0] @ 0000000005F58270
Entered hgopcda at 2014/09/22-13:35:08
Column:1(InterfaceID): dtype:2 (NUMERIC), prc/scl:20/0, nullbl:0, octet:0, sign:1, radix:10
Exiting hgopcda, rc=0 at 2014/09/22-13:35:08
Entered hgopcda at 2014/09/22-13:35:08
Column:2(TableName): dtype:-9 (WVARCHAR), prc/scl:30/0, nullbl:0, octet:60, sign:1, radix:0
Exiting hgopcda, rc=0 at 2014/09/22-13:35:08
Entered hgopcda at 2014/09/22-13:35:08
Column:3(TableID): dtype:4 (INTEGER), prc/scl:10/0, nullbl:0, octet:0, sign:1, radix:10
Exiting hgopcda, rc=0 at 2014/09/22-13:35:08
Entered hgopcda at 2014/09/22-13:35:08
Column:4(StatusCode): dtype:-9 (WVARCHAR), prc/scl:30/0, nullbl:0, octet:60, sign:1, radix:0
Exiting hgopcda, rc=0 at 2014/09/22-13:35:08
Entered hgopcda at 2014/09/22-13:35:08
Column:5(StatusTimestamp): dtype:93 (TIMESTAMP), prc/scl:23/3, nullbl:0, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2014/09/22-13:35:08
Entered hgopcda at 2014/09/22-13:35:08
Column:6(InterfaceLog): dtype:-9 (WVARCHAR), prc/scl:400/0, nullbl:1, octet:800, sign:1, radix:0
Exiting hgopcda, rc=0 at 2014/09/22-13:35:08
The hoada for table XXX_INTERFACE follows...
hgodtab, line 1073: Printing hoada @ 0000000005F58270
MAX:6, ACTUAL:6, BRC:1, WHT=6 (TABLE_DESCRIBE)
hoadaMOD bit-values found (0x40:TREAT_AS_NCHAR,0x400:UNICODE_COLUMN)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
3 DECIMAL N 22 22 20/ 0 0 0 0 InterfaceID
12 VARCHAR N 60 60 128/ 30 1000 0 440 TableName
4 INTEGER N 4 4 0/ 0 0 0 0 TableID
12 VARCHAR N 60 60 128/ 30 1000 0 440 StatusCode
91 DATE N 16 16 0/ 0 0 0 0 StatusTimestamp
12 VARCHAR Y 800 800 129/144 1000 0 440 InterfaceLog
Exiting hgodtab, rc=0 at 2014/09/22-13:35:08
Entered hgodafr, cursor id 0 at 2014/09/22-13:35:08
Free hoada @ 0000000005F58270
Exiting hgodafr, rc=0 at 2014/09/22-13:35:08
Entered hgotcis at 2014/09/22-13:35:08
Calling SQLStatistics for XXX_INTERFACE
IndexType=SQL_TABLE_STAT: cardinality=0
IndexType=1: PK_XXX_Interface
IndexType=3: IX_TableID
IndexType=3: IX_TableName
Calling SQLColumns for dbo.SQL_app_INTERFACE
#1 Column "InterfaceID": dtype=2, colsize=20, decdig=0, char_octet_length=0, cumulative avg row len=15
#2 Column "TableName": dtype=-9, colsize=30, decdig=0, char_octet_length=60, cumulative avg row len=60
#3 Column "TableID": dtype=4, colsize=10, decdig=0, char_octet_length=0, cumulative avg row len=64
#4 Column "StatusCode": dtype=-9, colsize=30, decdig=0, char_octet_length=60, cumulative avg row len=109
#5 Column "StatusTimestamp": dtype=93, colsize=23, decdig=3, char_octet_length=0, cumulative avg row len=125
#6 Column "InterfaceLog": dtype=-9, colsize=400, decdig=0, char_octet_length=800, cumulative avg row len=725
3 Index(es) found:
Index: PK_XXX_Interface, type=1, ASCENDING, UNIQUE, cardinality=0
#1 Column 1: InterfaceID
Index: IX_TableID, type=3, ASCENDING, NON-UNIQUE, cardinality=0
#1 Column 3: TableID
Index: IX_TableName, type=3, ASCENDING, NON-UNIQUE, cardinality=0
#1 Column 2: TableName
Exiting hgotcis, rc=0 at 2014/09/22-13:35:08 -
[8i] ORA-12704: character set mismatch (and other issues)
I've been trying to put together sample data on this problem since Friday, but I'm having issues. I'm thinking the problem is something specific to the old database I'm trying to work in:
BANNER
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
PL/SQL Release 8.1.7.2.0 - Production
CORE 8.1.7.0.0 Production
TNS for HPUX: Version 8.1.7.2.0 - Production
NLSRTL Version 3.4.1.0.0 - ProductionI tried copying over all the data into my test database:
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - ProductionAnd, I can't duplicate the problem there. In fact, I ran my original query in my test database, using the db llink, the query ran just fine.
But, I tried to create some sample data anyway to try to get some help here, so, I created 3 tables in my test database as SELECT from the old database (via a db link).
One table was really the results of a query (with many sub-queries) that was working just fine in the old database. It was the 2nd highest level query that wasn't giving me any problems. (Below, in my query, subquery 'a' runs just fine in the test database also; it's only the top level query that gives me an error.)
The other two tables I created were just simple sub-sets of the original tables in the old database.
I ran my query in my test database against those tables, and again, it ran just fine. No character set mismatch error.
So, based on the tables from the old database, I created the following test tables:
TEST TABLE DEFINITIONS
CREATE TABLE test_inv_1
( cust_id CHAR(10)
, item_id VARCHAR2(32) -- becomes 96 if I create as select
, match_item_id CHAR(10)
, docdate DATE
, tot_amt NUMBER(5)
INSERT INTO test_inv_1
VALUES('C1000','I0001','I0001',TO_DATE('01/01/2011','mm/dd/yyyy'),1000);
INSERT INTO test_inv_1
VALUES('C1000','I0002','I0002',TO_DATE('01/05/2011','mm/dd/yyyy'),1050);
INSERT INTO test_inv_1
VALUES('C1000','MANUAL ADJUSTMENT','MANUAL ADJ',TO_DATE('01/01/2011','mm/dd/yyyy'),1000);
INSERT INTO test_inv_1
VALUES('C1001','I0003','I0003',TO_DATE('01/01/2011','mm/dd/yyyy'),500);
INSERT INTO test_inv_1
VALUES('C1001','OTHER ADJUSTMENT','OTHER ADJU',TO_DATE('01/01/2011','mm/dd/yyyy'),50);
INSERT INTO test_inv_1
VALUES('C1001','M123','M123',TO_DATE('01/10/2011','mm/dd/yyyy'),150);
CREATE TABLE test_btab_1
( billing_id CHAR(10) NOT NULL -- becomes 30
, payment_terms_cd CHAR(3) -- becomes 9
INSERT INTO test_btab_1
VALUES ('I0001', '01');
INSERT INTO test_btab_1
VALUES ('I0002', '01');
INSERT INTO test_btab_1
VALUES ('I0003', '02');
INSERT INTO test_btab_1
VALUES ('M123', 'COD');
INSERT INTO test_btab_1
VALUES ('I0004', '01');
CREATE TABLE test_tabm_1
( record_type CHAR(4) NOT NULL -- becomes 12
, record_key CHAR(10) NOT NULL -- becomes 30
, numeric_1 NUMBER(15,5)
, numeric_5 NUMBER(7)
, numeric_6 NUMBER(7)
INSERT INTO test_tabm_1
VALUES ('LOCA','A1234',NULL,NULL,NULL);
INSERT INTO test_tabm_1
VALUES ('TERM','01',2,10,30);
INSERT INTO test_tabm_1
VALUES ('TERM','02',0,0,45);
INSERT INTO test_tabm_1
VALUES ('TERM','COD',0,0,30);Again, the first table, test_inv_1, is an example of the results of a query that was working just fine in the old database. (There are comments in the table definitions above--I'll explain those in a bit.)
Here is the query I ran against this data:
QUERY
SELECT a.*
, 1 - (t.numeric_1/100) AS amt_pst_disc
, a.docdate + t.numeric_5 - 1 AS disc_end_date
, a.docdate + t.numeric_6 - 1 AS duedate
FROM (
SELECT ic.*
, CASE
WHEN b.payment_terms_cd IS NULL
THEN CAST('03' AS CHAR(10))
ELSE CAST(b.payment_terms_cd AS CHAR(10))
END AS pay_term
, CASE
WHEN b.payment_terms_cd IS NULL
THEN 'Default Payment Terms'
END AS pt_flag
FROM test_inv_1 ic
, test_btab_1 b
WHERE ic.match_item_id = b.billing_id (+)
) a
, test_tabm_1 t
WHERE a.pay_term = t.record_key
AND t.record_type = 'TERM'
;In the old database, I get the error:
WHERE a.pay_term = t.record_key
ERROR at line 107: --this is actually line 22 in the above query, since test_inv_1 represents the results of a sub-query
ORA-12704: character set mismatchIn my test database, in every form, including with the sample data above, I don't have any problems.
I unfortunately don't have a v8 test environment, and I suspect there aren't many people who actually do, anymore, so using my v10 test database is the best I can do to come up with test data...
The other odd thing I noticed is that when I DESC the tables I created in my test database via SELECT statements, and compare them with the tables I created from CREATE statements (based on the table descriptions I got from the old database), some of the data lengths don't match up. That's what's in the comments in my table definitions. I noted where the tables I created via SELECT statements had different data lengths. I'm not sure if it's important or not, but in case it is, I thought I'd include it.
Also, I'm creating this query to make a report for someone else, and the reporting system only has access to the v8 database, not my test database. So, I'm stuck making the query run against it.
Any help on this would be greatly appreciated!I think it has something to do with my CASE statement. I found a kind of work-around solution. Instead of getting payment_term_cd associated with the item_id, the person I'm creating the report for wants the payment terms associated with the cust_id. Now, btab has the one associated with item_id, and not every item_id is in the btab table, so in my query, I was assuming a default value of '03' when it didn't find a payment_term_cd (i.e. it was NULL) for an item_id, which is what my first CASE statement is doing.
However, every cust_id definitely has a payment_term_cd associated with it (in another table I did not provide sample data for, since I didn't know I'd need to use it). Here's the general idea of that table:
CREATE TABLE test_cust_1
( cust_id CHAR(10) NOT NULL
, payment_terms_cd CHAR(3) --while it's not specified as NOT NULL, there are no NULLs for this column. I think anything that would be NULL, the system initializes as '***'
INSERT INTO test_cust_1
VALUES ('C1000','01');
INSERT INTO test_cust_1
VALUES ('C1001','03');
INSERT INTO test_cust_1
VALUES ('C1002','COD');So, there's no need for me to do a case statement. I can get away with something like:
SELECT ip.item_id
, ip.docdate
, ip.cust_id
, ip.tot_amt
, ip.pay_terms
, t.record_key
FROM (
SELECT i.item_id
, i.docdate
, i.cust_id
, i.tot_amt
, CAST(c.payment_terms_cd AS CHAR(10)) AS pay_terms
FROM test_inv_1 i
, test_cust_1 c
WHERE c.cust_id = i.cust_id
AND i.tot_amt <> 0
) ip
, test_tabm_1 t
WHERE t.record_key = ip.pay_terms
AND t.record_type = 'TERM'-- edited out the incorrect results
Anyway, when I used this new table with my original query in the 8i database, I didn't get a character set error, so that's why I think it has to do with the case statement.
Edited by: user11033437 on Aug 22, 2011 1:43 PM -- fixed an error in my results -
ORA-12704: character set mismatch odbc
Hi I have a query which is working find in most of the machines through ODBC connection. On one oracle server i am getting "ORA-12704: character set mismatch"
SELECT '' as Col1, Fname from CustTable
Where FPrefix = ''user8971316 wrote:
Hi I have a query which is working find in most of the machines through ODBC connection. On one oracle server i am getting "ORA-12704: character set mismatch"
SELECT '' as Col1, Fname from CustTable
Where FPrefix = ''
bcm@bcm-laptop:~$ oerr ora 12704
12704, 00000, "character set mismatch"
// *Cause: One of the following:
// - The string operands(other than an nlsparams argument) to an
// operator or built-in function do not have the same character
// set.
// - An nlsparams operand is not in the database character set.
// - String data with character set other than the database character
// set is passed to a built-in function not expecting it.
// - The second argument to CHR() or CSCONVERT() is not CHAR_CS or
// NCHAR_CS.
// - A string expression in the VALUES clause of an INSERT statement,
// or the SET clause of an UPDATE statement, does not have the
// same character set as the column into which the value would
// be inserted.
// - A value provided in a DEFAULT clause when creating a table does
// not have the same character set as declared for the column.
// - An argument to a PL/SQL function does not conform to the
// character set requirements of the corresponding parameter.
// *Action: -
Ora-12704: character set mismatch
I'm trying to insert string data into a nvarchar2 column using jdbc and I keep getting the error, ora-12704: character set mismatch. How do I avoid this without using the translate function? I believe my nls variables are all set correctly. Our software will eventually be in Korean.
Both my database and national character sets are UTF8.
We are trying to design a system
that supports internationalization. Majority
of our customers will be using English but we do have Korean customers. All their data will be in korean. It is my understanding (and I could be wrong) that the korean character set is varying multi-byte. This understanding has lead me to believe I need to define my "character" columns as nchar and nvarchar2. Is this assumption wrong?
Also, my nls_lang environment variable is AMERICAN_AMERICA.UTF8. I'm currently running Oracle 8.1.6. We have received 8.1.7 but I haven't upgraded yet.
Thanks in advance! -
Character set mismatch with UTF-8
I get character set mismatch error when attempting to run a JDBC PreparedStatement to query
a table with primary key column of type NCHAR
I'm using the thin 8i driver
I'm using setString() to set the bind the parameter value to the statement
Some of the documentation makes it sound like the driver will convert between character
sets automatically. Other parts make it look like I should use the setCHAR() method of
Oracle's OraclePreparedStatement class.
Is there an easy way to do this ?I get character set mismatch error when attempting to run a JDBC PreparedStatement to query
a table with primary key column of type NCHAR
I'm using the thin 8i driver
I'm using setString() to set the bind the parameter value to the statement
Some of the documentation makes it sound like the driver will convert between character
sets automatically. Other parts make it look like I should use the setCHAR() method of
Oracle's OraclePreparedStatement class.
Is there an easy way to do this ? -
Conversion of character sets (UCS2 of MSSQL to AL32UTF8 of Oracle Warehouse
Hi all,
I installed my enviroment as below.
Server:
Windows 7 Professional
SQL Server 20012
Character Set: UCS2
Client:
Linux REDHAT 5
Oracle Warehouse 11gR2 (11.2.0.1)
Oracle Database Gateway for MSSQL Server 11.2.0.1
Character Set:AL32UTF8
I installed the gateway for connecting the Oracle Warehouse with MSSQL DB. However, the characters are not readable, because the character of MSSQL DB is coded via one byte character, and the Oracle character is coded like multibyte character.
Input:
Table name on the MSSQL DB: Table_Name
Output:
Table name on the Oracle Warehouse Import Wirzard:◊T◊a◊b◊le◊_◊N◊a◊m◊e
It causes error by importing the table, because the OWB doesn't allow the unreadable characters of table name.
Do you have an idea for resolving it.
Thanks and kind regards,
HipOk, I have changed it as you wrote:
HS_FDS_CONNECT_INFO=100.30.4.157:1433//bob
HS_FDS_TRACE_LEVEL=255
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_TRANSACTION_MODEL=READ_ONLY
HS_LANGUAGE=american_america.we8mswin1252
HS_NLS_NCHAR=UCS2
HS_NLS_LENGTH_SEMANTICS=CHAR
and I also added the listern.ora:
(SID_DESC =
(SID_NAME=bob)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_2)
(ENVS=LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_2/dg4msql/driver/lib;/u01/app/oracle/product/11.2.0/dbhome_2/lib)
(PROGRAM=dg4msql)
tnsname.ora:
bob =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA = (SID = bob))
(HS = OK)
SQL> select * from all_users@bob;
USERNAME USER_ID CREATED
public 0 08-APR-03
dbo 1 08-APR-03
guest 2 08-APR-03
INFORMATION_SCHEMA 3 13-APR-09
sys 4 13-APR-09
db_owner 16384 08-APR-03
db_accessadmin 16385 08-APR-03
db_securityadmin 16386 08-APR-03
db_ddladmin 16387 08-APR-03
db_backupoperator 16389 08-APR-03
db_datareader 16390 08-APR-03
db_datawriter 16391 08-APR-03
db_denydatareader 16392 08-APR-03
db_denydatawriter 16393 08-APR-03
14 rows selected.
The Oracle Warehouse Builder still has the same error by the conversion of character sets.
Hip -
Heterogeneous system copy from MSSQL to Oracle
Dear Experts,
I have performed ABAP+JAVA system copy R3load based from Oracle to Oracle and MSSQL to MSSQL platform.
Homogeneous system copy many times.
But this is first time i am perfoming an Export from MSSQL source system with r3load Export method .....My Target system is havign Oracle 10.2.0.2 software installed along with installation prerequisites.
But while Importing the same MSSQL Export ...I am not getting any option for heterogeneous system copy.
I am running on ECC6.0 windows platform and i also have generated Migartion KEY.
But where should i put this key.
I have gone through system copy guide many times but unable to understand Exact options to follow to Migrate to Oracle target system. Appreciate if anyone can give me detail steps i need to carry on Target system
Best Regards,
AjitRMarkus,
Thanks for the help, i have done Export with mentioned way and this time DBSIZE.xml file got created under ORA directory ....i started installation at target system....It went smooth until phase Import java Dump Done. .....But during Post load activities It gave error...
When i tried connectivity to Oracle database it works fine and
R3trans -d gives below mentioned error....Looks like table does not exist....all ENV variables are also got set at target machine.....
Error as below
Now 'SAPSR3/<pwd>@TST' is connected (con_hdl 0, nls_hdl 0).
4 ETW000 389 0.171885
4 ETW000 [dev trc ,00000] Database NLS settings: AMERICAN_AMERICA.UTF8 23682 0.195567
4 ETW000 [dev trc ,00000] Database instance TST is running on CSSLDELL-3 with ORACLE version 10.2.0.2.0 since 20080522
4 ETW000 4056 0.199623
4 ETW000 [dev trc ,00000] Connection 0 opened (DBSL handle 0) 14523 0.214146
4 ETW000 [dblink ,01299] ***LOG BZA=>table SVERS does not exist on database [dblink#3 @ 1299]
4 ETW000 8145 0.222291
4 ETW000 [dev trc ,00000] NTAB: SELECT COMPCNT FROM DDNTT FAILED 1021 0.223312
4 ETW000 [dev trc ,00000] NTAB: SELECT VERSION FROM DDNTT FAILED 520 0.223832
4 ETW000 [dbntab.c ,00000] *** ERROR => NTAB: SELECT VERSION/DBASE FROM DDNTT FAILED
4 ETW000 505 0.224337
4 ETW000 [dbntab ,01273] ***LOG BZY=>unexpected return code 103 calling NTAB [dbntab#3 @ 12737]
Please help...Points rewarded anyways..... -
Help:character set mismatch after DB installation
hai friends,
After my oracle installtion database character set *(AL32UTF8)* and client character
set*(WE8MSWIN1252)* became different..and a message specifies that i can set client character set through
HKLM/SOFTWARE/ORACLE/KEY_trial registry..so what i suposed to do..now the NLS_LAG.reg contains the value as AMERICAN_AMERICA.WE8MSWIN1252...so for changing from one character set to another what i have to type inside NLS_LAG.reg...
thanks in advance...The client character set must match the Operating System code page, so check HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage\, look for an entry with name ACP, if its value is "1252" then NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252 is OK. See Note *179133.1* The correct NLS_LANG in a Windows Environment for more information.
HTH
Enrique -
How to fix ORA-12704: character set mismatch
I am newish to oracle and am trying to work out why the following doesn't work:
create table utest(test nvarchar2(100));
insert into utest values('fish');
select test from utest union select '' from utest;
I need to be able to do a union on a table with an nvarchar2 fields, where on union, some of the columns are simply ''.
Not quite sure how to work out which oracle version exactly this is, we are given remote access via JDBC.Hi
i have a similar issue on a customer. unfortunatly i am not able to modify the commands because i am not the developer. but i see in the logfile, that a ORA-12703 - Character Set Missmatch Occours after a specifiec command. after some investigation i found the command:
SELECT * FROM (SELECT DISTINCT ATTACHMENTID, FTN.USERID, FTN.MSGID, FTN.TYPEFLD, DS.DOCSERVERID, DOCSERVERPATH, DSTYPE,DSENABLED, DA.DATAARCHIVEID,FILENAME, STARTINGPOS, COMPRESSEDSIZE, UNCOMPRESSEDSIZE, MSGDATEHIGH, MSGDATELOW, FLAGS, STORAGEMETHOD, SUBJECT, FROMFLD FROM CONTAINSATTACHMENT CA RIGHT JOIN FT_NOTIFY FTN ON CA.MSGID=FTN.MSGID , PROFILE P, PROFILELOCATION PL, DATAARCHIVE DA, DOCUMENTSERVER DS WHERE FTN.MSGID >= 547609 AND FTN.MSGID <= 557609 AND P.MSGID=PL.MSGID AND DS.DOCSERVERID=DA.DOCSERVERID AND DA.DATAARCHIVEID=PL.DATAARCHIVEID AND FTN.MSGID=P.MSGID AND FTN.SEARCH_INDEX_ID=2 AND TYPEFLD='A' UNION SELECT DISTINCT NULL AS ATTACHMENTID, FTN.USERID, FTN.MSGID, FTN.TYPEFLD,0 AS DOCSERVERID,'' AS DOCSERVERPATH,0 AS DSTYPE,0 AS DSENABLED,0 AS DATAARCHIVEID,'' AS FILENAME,0 AS STARTINGPOS,0 AS COMPRESSEDSIZE,0 AS UNCOMPRESSEDSIZE,0 AS MSGDATEHIGH,0 AS MSGDATELOW,-1 AS FLAGS, 0 AS STORAGEMETHOD,'' AS SUBJECT, '' AS FROMFLD FROM FT_NOTIFY FTN WHERE FTN.MSGID >= 547609 AND FTN.MSGID <= 557609 AND FTN.SEARCH_INDEX_ID=2 AND TYPEFLD='R') ORDER BY MSGID
when i replace the "'' AS..." in the bottom of the script with the "cast( '' as nvarchar(255)) AS..." it works as expected. as i sayd, i cant change the code but we have the system working for ages and after we set up a new server, it stops working - so can it be possible that other versions of Oracle (Server or Client) support this without a cast? Or is there some "Special Setting" what can help here?
Thank you in advance
Martin -
Character set mismatch during import
I have exported a tablespace from a database using transportable tablespace option
with CHARACTERSET UTF8. And I tried to import into another db where the CHARACTERSET is US7ASCII. Now it says that it cannot import because the charactersets are different. Is there any way to get around this problem?
Regards,
Kallur Manoj.Manoj,
One of the limitations for transportable tablespace is that the source and target databases should use the same character set and national character set.
You may need to either export the tablespace with us7ascii, or import to a db with utf8 characterset.
AGK -
ORA-24812: character set conversion to or from UCS2 failed
Oracle 9.2.0.4
PHP 4.3.3
data in db is in unicode UTF8
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
Then reading more than N Kb from CLOB I get ORA-24812.
If clob less than N Kb it's working fine.
On 9.2.0.1 SELECT convert(myclob, 'UTF16','AL32UTF8') causing instance crash.
Can you help me ?What PHP DB interface are you using (oci8 calls, PEAR
DB etc)?OCI8
>
How big is "N kb"? Is it always this size?I don't know ... in CLOB I store serialized php array (report), where are problem only on one realy big report.
>
What does "instance crash" mean? The whole DB
instance,
the Oracle shadow process, or the PHP session?Whole instance, but in 9.2.0.4 it fixed. -
Hi,
I'm trying to update an NCLOB field with a plain text file (Word ML format). I know that I have to convert the text to NCLOB using the to_NCLOB function. But, the function requires an argument, it doesn't take a file. What else can I use to convert A FILE to NLCOB???
Thanks in advance,
Marc.Remember that an external file is not a database object and then it can't be referenced by other database objects.
Anyway to receive an answer it would be helpful if you say:
- What is your environment (oracle forms, a web application, a client-server application you're developing or ...what else).
- Where the file is stored (in the host of the RDBMS, in the client machine or somewhere else ).
Bye Alessandro -
Database character set = UTF-8, but mismatch error on XML file upload
Dear experts,
I am having problems trying to upload an XML file into an XMLType table. The Database is 9.2.0.5.0, with the character set details:
SELECT *
FROM SYS.PROPS$
WHERE name like '%CHA%';
Query results:
NLS_NCHAR_CHARACTERSET UTF8 NCHAR Character set
NLS_SAVED_NCHAR_CS UTF8
NLS_NUMERIC_CHARACTERS ., Numeric characters
NLS_CHARACTERSET UTF8 Character set
NLS_NCHAR_CONV_EXCP FALSE NLS conversion exception
To upload the XML file into the XMLType table, I am using the command:
insert into XMLTABLE
values(xmltype(getClobDocument('ServiceRequest.xml','UTF8')));
However, I get the error:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00200: could not convert from encoding UTF-8 to UCS2
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1
Why does it mention UCS2, as can't see that on the Database character set?
Many thanks for your help,
MarkUSC2 is known as AL16UTF16(LE/BE) by Oracle...
Try using AL32UTF8 as the character set name
AFAIK The main difference between Oracle's UTF8 and AL32UTF8 character set is that is the UTF8 character set does not support those UTF-8 characteres that require 4 bytes..
-Mark -
How to change the Character Set from AL32UTF8 to WE8DEC
Hello!!
I want to know how to change the character set in the database from AL32UTF8 to WE8DEC.
I tried to use the comand ALTER DATABASE CHARACTER SET but I got an error because WE8DEC is not a superset of AL32UTF8.
I need to import tables from a server that uses WE8DEC. So when I do the import to my server, wich has AL32UTF8 , I can't import the rows that include an Ñ.
So I want to change the caracter set to WE8DEC. How can I do it?
Is it needed to change the language configuration? The remote server has AMERICAN_AMERICA, and my server has MEXICAN SPANISH_MEXICO (both uses text in spanish).
Thanks a lot!!When you export from WE8DEC server what did you use
for NLS_LANG char set? And when importing?
The export was done in another computer because I can't do the export in the server (I have 10g, and the remote server has 9i and the export is not working). In my server, when I tried to do the import, the NS_LANG value was MEXICAN SPANISH_MEXICO.WE8MSWIN1252.
When I try to import to my database I got the error:
import done in WE8DEC character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export client uses WE8MSWIN1252 character set (possible charset conversion)
. importing USRMCR06's objects into PRIMARIZACION
. . importing table "CHG_FONDOS_MARZO_CD_MOR"
IMP-00019: row rejected due to ORACLE error 12899
IMP-00003: ORACLE error 12899 encountered
ORA-12899: value too large for column "PRIMARIZACION"."CHG_FONDOS_MARZO_CD_MOR".
"NOMBRE" (actual: 41, maximum: 40)
Column 1 16623436
Column 2
Column 3 Pymes_1
Column 4
Maybe you are looking for
-
HT2736 how can i get a itunes gift cards and itunes gifts code ?
how can i get a itunes gift code?
-
How to read an XML file into a java program?
hi, i want to load the following very simple xml file in my java program. <root> <weblogic> <url value="t3://192.168.1.160:7001" /> <context value="weblogic.jndi.WLInitialContextFactory" /> </weblogic> </root> I am getting the error: " Line=1: cvc-el
-
Create a new line item in sales order
Hi, I have to create a new line item in a sales order. The scenario is that if we donot find the desired quantity from a plant. Then we have to go ahead and pick the remaining quantity from another plant and automatically create a new line item.The n
-
Dear All, Can you please explain the use of the below fields in the infoset ?,For your reference please find the attachment.
-
Cluster script convert commands
In a rolling cluster upgrade, the scripts (in iManager) show up in eDir If you need to adjust those (in the case of GroupWise), is it okay to simply put the LINUX version in the scripts? (meaning via iManager)? Providing of course, you change your fa