Is possible to create a trigger or a parameter in connection String that truncate a varchar when it passes the limit?
I’ve tried to create a trigger Before insert/update but i continue to get the following exception:
java.io.IOException: java.sql.BatchUpdateException: data exception: string data, right truncation
at org.apache.gora.sql.store.SqlStore.flush(SqlStore.java:340)
at org.apache.gora.sql.store.SqlStore.close(SqlStore.java:185)
The gora is because i am using nutch.
Thanks
EDIT1:
The trigger is:
CREATE TRIGGER typeconversionUpdate BEFORE UPDATE ON WEBPAGE
REFERENCING NEW AS newrow
FOR EACH ROW SET newrow.TEXT=”
And the create statement:
CREATE TABLE WEBPAGE (id VARCHAR(512) PRIMARY KEY,headers BLOB,text VARCHAR(32000),status INTEGER,markers BLOB,parseStatus BLOB,modifiedTime BIGINT,score FLOAT,typ VARCHAR(32),baseUrl VARCHAR(512),content BLOB(65536),title VARCHAR(512),reprUrl VARCHAR(512),fetchInterval INTEGER,prevFetchTime BIGINT,inlinks BLOB,prevSignature BLOB,outlinks BLOB,fetchTime BIGINT,retriesSinceFetch INTEGER,protocolStatus BLOB,signature BLOB,metadata BLOB)
A possible solution is to increase the maximum size of the column in question:
The trigger solution cannot be used with HSQLDB up to version 2.2.9, but may be allowed in the next version.