background :
Development language: C #
Development tools: VS2010
A-party Oracle database: Chinese Character set
B-party Oracle database: English Character set
Delivery Mode: WebService method (take data, and put the extracted data into the DataTable, loop back to write to the B-side of the stored procedure)
Questions :
From a-side library to get the data inserted into the B-side library written in the stored procedure, to the B-side database, the Chinese characters are garbled (more question marks)
Workaround :
Method One: Use Oracle's conversion function to utl_raw the data from the A-side library initially. Cast_to_raw convert the field, which is select Utl_raw. Cast_to_raw (a) from a
Stored procedures for receiving data in B-side libraries should be parsed with the UTL_RAW.CAST_TO_VARCHAR2 () function and inserted into the B-party library.
Result: No data received from B-side library
Method A failure reason, followed by the direction of direct query select Utl_raw. Cast_to_raw (a) from a in a party library is displayed binary code, but the queried data can not be stored in the DataTable, into the DataTable into a system.data[], the display is not a string caused by the detection, The idea of converting a converted data query into a string
Method Two:
Use the Oracle character intercept function to convert to a string (To_char is not a line), with the statement: Select SUBSTR (Utl_raw. Cast_to_raw (a), 0,length (Utl_raw. Cast_to_raw (a))) The stored procedure is still inserted into the B-side library with the UTL_RAW.CAST_TO_VARCHAR2 () function after the data is received from the A;b Party library.
Results: Chinese characters show normal in B-side library.
C # Obtains and writes the Chinese and English character set problems in the Oracle database