Re: Error with Clob

Tmo_hsqldb_q <[email protected]>
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <[email protected]>
Understood.  The compression will also be very useful!
Correct me if i'm wrong.  In the below example I'll have to cast the
clobcolumn to longvarchar in the Trigger declaration, because as you
described earlier in the chain:
"In general, BLOB and CLOB cannot be used as parameters to Java routines, "





CREATE TABLE testtable3 
( 
   clobcolumn CLOB(1M)     NOT NULL 
); 



CREATE TRIGGER testtable3_TRIG AFTER INSERT ON testtable3 
referencing NEW ROW AS newrow 
FOR EACH ROW WHEN (newrow.clobcolumn IS NOT NULL) 
CALL testtableupdate3(CAST(newrow.clobcolumn AS LONGVARCHAR)); 




CREATE PROCEDURE testtableupdate3(testmessage LONGVARCHAR) 
MODIFIES SQL DATA 
LANGUAGE JAVA 
EXTERNAL NAME 'CLASSPATH:TestTableTrigger.testTableUpdate' 




import java.sql.*; 

public class TestTableTrigger 
{ 

        public static void testTableUpdate(Connection triggerConn, String
testmessage) throws Exception 
        { 

                        System.out.println("TestTableTrigger - testmessage =
" + testmessage); 
        } 

} 


CREATE PROCEDURE testclob(testmessage CLOB(1M)) 
MODIFIES SQL DATA 
BEGIN ATOMIC 

     INSERT INTO testtable3(clobcolumn) 
     VALUES(testmessage); 

END 




--
View this message in context: http://hsqldb.10974.n7.nabble.com/Error-with-Clob-tp151p3860.html
Sent from the HSQLDB - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.