Issue Details (XML | Word | Printable)

Key: DERBY-52
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Jason Palmatier
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Derby

Cannot create CHAR column with size greater than 254

Created: 29/Oct/04 09:44 PM   Updated: 19/Jan/09 08:13 AM
Return to search
Component/s: Documentation
Affects Version/s: 10.0.2.0
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Dell Dimension 2350, 2GHz P4, 1 Gig RAM,
Window XP Pro Version 2002, SP2
JDK 1.4.2_03, build 1.4.2_03-b02
Derby Snapshot SVN version 46005 (Binaries)
Issue Links:
Reference
 

Resolution Date: 26/Apr/05 02:02 PM


 Description  « Hide
An attempt to create a table that contains a column of type CHAR with a size greater than 254 using the SQL statement

CREATE TABLE dummyTable ( column1 char(255),column2 char(10),column3 char(10) )

results in the following SQL Exception:

SQL Exception: The length, precision, or scale attribute for column, or type mapping 'CHAR(255)' is not valid.
SQL Error: 30000
SQL State: 42611

However, if you decrease column1's length by one as below, the table is created successfully:

CREATE TABLE dummyTable ( column1 char(254),column2 char(10),column3 char(10) )

The Derby Reference Manual states that the limit on the length of a CHAR data type is java.lang.Integer.MAX_VALUE:

http://incubator.apache.org/derby/manuals/reference/sqlj128.html#HDRSII-SQLJ-13733



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.