Home » SQL & PL/SQL » SQL & PL/SQL » Convert function, problem with fonts
Convert function, problem with fonts [message #415380] Mon, 27 July 2009 08:46 Go to next message
jelizavetat
Messages: 3
Registered: July 2009
Junior Member
Hello,
I have the following problem:

1) When I select the data using db link, the convert function works properly:

select ab.branch_name, convert(ab.branch_name,'NEE8ISO8859P4','BLT8MSWIN1257') as branch_convert
from issuing2_0.izd_branches@pbo9 ab
/
BRANCH_NAME BRANCH_CONVERT
-------------------- --------------------
Al?ksnes fili?le Alūksnes filiāle

2) When I try to insert the data into table using the same select, I have wrongly converted data in TEXT2 field

create table test(text1 varchar(100),text2 varchar2(100)) ;

insert into test
select ab.branch_name, convert(ab.branch_name,'NEE8ISO8859P4','BLT8MSWIN1257') as branch_convert
from issuing2_0.izd_branches@pbo9 ab;

TEXT1 TEXT2
-------------------- --------------------
Al?ksnes fili?le Al?ksnes fili?le

Could someone help me to get correct data in TEXT2 field?
Re: Convert function, problem with fonts [message #415406 is a reply to message #415380] Mon, 27 July 2009 10:25 Go to previous messageGo to next message
ora_baby
Messages: 89
Registered: May 2008
Member
SQL> create table temp1(col1 varchar(50), col2 varchar(50));

Table created.

SQL> insert into temp1(col1, col2)
  2  values('привет', 'hello');

1 row created.

SQL> select * from temp1;

COL1
--------------------------------------------------
COL2
--------------------------------------------------
привет
hello

SQL> select convert(col1,'US7ASCII','WE8ISO8859P1'), col2 from temp1;

CONVERT(COL1,'US7ASCII','WE8ISO8859P1')
----------------------------------------------------------------------
COL2
--------------------------------------------------
i?ea?o
hello

SQL> create table temp2(col1 varchar(100), col2 varchar(100));

Table created.

SQL> select * from temp2;

no rows selected

SQL>  insert into temp2(col1, col2)
  2   select convert(col1,'US7ASCII','WE8ISO8859P1'), col2 from temp1;

1 row created.

SQL> select * from temp2;

COL1
--------------------------------------------------------------------------------
COL2
--------------------------------------------------------------------------------
i?ea?o
hello


that is ok
Re: Convert function, problem with fonts [message #415487 is a reply to message #415380] Tue, 28 July 2009 01:40 Go to previous messageGo to next message
jelizavetat
Messages: 3
Registered: July 2009
Junior Member
In my case I have correct result (Alūksnes filiāle) after simple select and incorect result (Al?ksnes fili?le) when I using the same select try to insert this value in my own table.
Re: Convert function, problem with fonts [message #415625 is a reply to message #415380] Tue, 28 July 2009 07:47 Go to previous message
jelizavetat
Messages: 3
Registered: July 2009
Junior Member
The database character set - BLT8MSWIN1257 concurs with NLS_LANG setting on the client -BLT8MSWIN1257. Data coming into the database is encoded in WE8MSWIN1252. How I can use convert function to insert these data correctly?
Previous Topic: Grouping via analytical function
Next Topic: How to schedule a job depending on any condition
Goto Forum:
  


Current Time: Sun Dec 04 00:35:40 CST 2016

Total time taken to generate the page: 0.08859 seconds