CLOB size, Trigger, <PRE>
Posted on 2001-07-11
Q1. CLOB allows 4GB of char data. I created a table like "CREATE TABLE aclob (id number, text clob)". When I do the "desc" on this table it shows me text as CLOB(4000). I tried to enter the data more than 4000 chars and the Oracle gives me the error "ORA-01704: string literal too long". Does that means by default the CLOB allows 4000 max chars. Do I need to create the table something like "CREATE table aclob (id number, text clob(20000)" so that it accept 20000 max chars. I am using Oracle 8.1.5 (with JDBC2.0 API) and Java/JDBC.
Q2. When I do not have any text to enter in my CLOB field I am entering NULL in it. It works fine. But then I came across this method named "empty_clob()". One can use this to insert instead of null. What this method is for. Do we need to use this method *preferably* instead of null in case there are no chars to be inserted in the CLOB field. Any advantages!
Q3. What is the basic difference between Before and After trigger. I think the difference lies only in that in after trigger you cannot set the values of the fields going in the table on which this trigger is fired!
Q4. <PRE>...</PRE> causes a new empty line to be added at its end. How to stop this new emty line to be added.