when use CLOB field, problem with korean alphabet (2byte Character)

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kwon

when use CLOB field, problem with korean alphabet (2byte Character)

Post by kwon » Wed 29 Dec 2004 02:17

:?:
Using OraSession.Option.Net = true

Server script :
CREATE TABLE ODAC_CLOB
(
CODE NUMBER,
TITLE VARCHAR2(30 BYTE),
VALUE CLOB
)

Application script :
insert into odac_clob(code, title, value)
values(:p_code, :p_title, :p_value)
parambyname(':p_value') := '권성태' <--- korean character

select value from odac_clob

Result :
1Byte Character is correct (ex: English character)
but
2Byte Character is not (ex: Korean character)

how get correct result by korean character?

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Wed 29 Dec 2004 12:14

You should use the next SQL to insert Clob fileds:

Code: Select all

INSERT INTO ODAC_CLOB (Code,Title,Value)
  VALUES (:Code, :Title, EMPTY_CLOB())
RETURNING
  Value
INTO
  :Value
and watch DataType and ParamType properties of CLOB parameter closely :

Code: Select all

OraSQL1.ParamByName('Value').ParamType := ptInput;
OraSQL1.ParamByName('value').DataType := ftOraClob;
also you should use the next code to set param value:

Code: Select all

OraSQL1.ParamByName('value').AsOraClob.AsString := 'Your CLOB data';
Please read carefully "Working with BLOB and CLOB data types" topic in ODAC
help.

As to Korean characterset we suggest you to use unicode support. You can use
TOraSession.UseUnicode property to enable this behaviour.

Note: Unicode character data support with Net option for Oracle 9i
is available since ODAC version 5.10.

If you need more info pls. see ODAC help, "Working with Unicode character
data" topic.

Guest

Post by Guest » Mon 03 Jan 2005 06:37

Hi, Alex

i excuted your example code.

but error returned.

ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 775
ORA-06512: at line 1

i need your help....

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Tue 04 Jan 2005 07:25

Send us please small demo project to demonstrate the problem and include script to create server objects to ODAC support address.

Guest

Opps...

Post by Guest » Thu 06 Jan 2005 06:54

hi...

"INSERT" is no problem....

But,
"SELECT" is promblem..

Using "ODAC4.5 - Net Option.."
Incorrect Data Return...

OCI Option Using...
No problem..

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Thu 06 Jan 2005 10:34

NLS(National Language Support) and Unicode support in ODAC 4.50 with "Net" option is available only for Oracle 8i server, higher Oracle server versions are supported since ODAC version 5.10.

Post Reply