开发者

Oracle 10gR2 CLOB Data type

I am having table with clob column & trying to insert SIGNED character data which contains =176048 characters, it throws error 开发者_如何学Gohas Insert exception data transaction java.sql.SQLException: ORA-01704: string literal too long


From this AskTom answer:

Yes, you can insert upto 4000 bytes in an INSERT statement -- just

insert into t ( clob_col ) values ( 'Hello World' );

it works. For larger chunks, you would insert an EMPTY_CLOB() and then using that newly created lob locator write to it in chunks. It would look like this:

begin
  insert into t ( clob_col ) values ( empty_clob() )
  returning clob_col into Local_Variable;

  dbms_lob.write( local_variable, .... );

end; 
/

in plsql.


You can only insert string literals of at most 4000 characters. Otherwise you need to use a bind variable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜