Hi,
Please help me to solve this problem. I need to fix
it urgently.
I have a very simple function:
MY_FUNCTION()
File name: my_function.java
package
org.enhydra.instantdb.db;
import
org.enhydra.instantdb.db.SqlFunction; import java.sql.*;
class my_function implements SqlFunction
{
public int checkParameters
(int[] parameterTypes) throws SQLException {
return
TYPE_STRING; // our
return type }
public void setSpecialValue(int type, Object
value) { }
public Object getSpecialValue (int type) throws
SQLException { return
null; }
public
Object evaluate(Object[] parameters) throws SQLException
{ return
"0123456789012345678901234567890";
//string length = 31 } }
Run a SQL statement SELECT MY_FUNCTION() myalias FROM AnyTable
I got an exception
java.sql.SQLException: java.sql.SQLException:
Column myalias cannot accept
value 0123456789012345678901234567890
at
org.enhydra.instantdb.db.SQLProg.execute(SQLProg.java:288)
at
org.enhydra.instantdb.jdbc.idbStatement.execute(idbStatement.java:235 )
at
JDBCAppl.action(JDBCAppl.java:214)
at java.awt.Component.handleEvent(Unknown
Source) at
JDBCAppl.handleEvent(JDBCAppl.java:270)
But if the return string from MY_FUNCTION() has
length=30, e.g 012345678901234567890123456789, then everything's fine,
there's no exception.
Is there any way to set again the limit of string
length to make it longer than 30? Or any way to work around?
Thanks,
Huy
|