tuzai:
技术贴:如何往oracle的clob字段存储汉字?
[阅读: 742] 2005-06-22 15:02:21
代码如下:
procedure TAccessDrv.Add(const FieldName: string; FieldType: TFieldType; FieldValue: wideString);
var
id: string;
stream: TStream;
begin
FQry.SQL.Text := 'insert into table1 (id, ' + FieldName + ') ' +
' values(:id, empty_clob()) returning content into :content' ;
Randomize;
id := IntToStr(Random(999));
FQry.Params.ParamByname('id').datatype := ftWidestring;
FQry.Params.ParamByname('id').value := id;
FQry.Params.ParamByname('content').datatype := ftMemo; //试验了几遍,选其他类型的都不行
FQry.Params.ParamByname('content').value := FieldValue;
FQry.ExecSQL;
end;
结果:
英文插入正确,汉字插入不正确;
使用ado + oracle的oledb