InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: InstantDB: length limitation


What is the size of this attribute in the database?
 
You should post your database schema for this table.
-----Original Message-----
From: owner-instantDB@enhydra.org [mailto:owner-instantDB@enhydra.org]On Behalf Of Ho Quang Huy
Sent: Wednesday, May 02, 2001 10:55 PM
To: instantdb@enhydra.org
Subject: InstantDB: length limitation

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