Question

How to retrieve data in java from memo field,i am using progress database. But it's giving error:

[DataDirect-Technologies][ODBC PROGRESS driver][PROGRESS]Column Doc_Desc in table PUB.GLDOCHDR has value exceeding its max length or precision.

Wrote code like this sql:

selectSQL="select Doc_Desc from PUB.GLDOCHDR where Doc_Desc like '%:%' and Doc_Desc like '%@%'";

Retrieving data like this:

rs = stmt.executeQuery(selectSQL);
while( rs.next())
{
    BufferedReader br = new BufferedReader(new InputStreamReader(rs.getAsciiStream("Doc_Desc")));                   
    System.out.println(br.readLine());
}
Was it helpful?

Solution

Progress (OpenEdge) has two "personalities" -- SQL and 4GL.

The 4GL (or "ABL") engine is most commonly used and it does not care how wide a field is. All data is variable width. The width is just a suggestion for display formatting purposes and is routinely ignored by programmers.

Naturally this gives SQL tools fits.

There is a tool provided to ease your pain -- "dbtool" will scan the database and adjust the "sql-width" to reflect the actual maximum width that it finds in the data. This is commonly run on a regular basis (usually weekly or monthly) in most Progress shops that use SQL.

http://knowledgebase.progress.com/articles/Article/P24496

http://knowledgebase.progress.com/articles/Article/P159769

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top