Using
with OraSession do
begin
Options.Net := True;
Options.CharLength := 0;
Options.Charset := '';
Options.UseUnicode := True;
end;
Server script :
CREATE TABLE ODAC_CLOB
(
CODE VARCHAR2(30 BYTE),
TITLE VARCHAR2(30 BYTE),
VALUE CLOB
)
Application query:
INSERT INTO odac_clob(code, title, value)
VALUES (:code, :title, EMPTY_CLOB())
RETURNING
value
INTO
:value
SmartQuery1.ParamByName('code').AsString := 'Code Key';
SmartQuery1.ParamByName('title').AsString := 'titel subject';
SmartQuery1.ParamByName('value').ParamType := ptInput;
SmartQuery1.ParamByName('value').DataType := ftOraClob;
SmartQuery1.ParamByName('value').AsOraClob.AsString := '안녕하세요'; <--- korean character
SmartQuery1.Execute;
excuted..
error return..
ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 775
ORA-06512: at line 1
why?
CLOB Insert error
You must use the following code in this situation
Code: Select all
SmartQuery1.ParamByName('value').AsOraClob.IsUnicode := True;
SmartQuery1.ParamByName('value').AsOraClob.AsWideString := Widestring('안녕하세요'); //<--- korean
thank you Paul!!!!!
Paul wrote:You must use the following code in this situation
Code: Select all
SmartQuery1.ParamByName('value').AsOraClob.IsUnicode := True; SmartQuery1.ParamByName('value').AsOraClob.AsWideString := Widestring('안녕하세요'); //<--- korean