Subject | Diagnose SQL error code -303 |
---|---|
Author | Chris LeFebvre |
Post date | 2015-03-15T04:28:36Z |
I have at least a dozen different Firebird databases that I’ve created for my own personal use over the years and I develop the front end in Delphi. I recently created a new database for a project and I’d been adding new data into it successfully until today when I tried to insert what would have been the 105th record and my program threw a SQL error -303. I tried a number of different things to try and figure out what is causing the problem but when I wasn’t making any headway I tried opening the database in Database Workbench 3.4.4 and querying the table that is having the problem and then manually trying to add a new record and this is the error I’m getting:
ISC ERROR CODE:335544569
ISC ERROR MESSAGE
Dynamic SQL Error
SQL error code = -303
Arithmetic exception, numeric overflow, or string truncation
Unexpected end of file on backup file
The layout of the table is fairly simple:
CREATE TABLE PLAYLISTS
(
ARTIST CHAR( 100) COLLATE UTF8,
TITLE CHAR( 100) COLLATE UTF8,
GENRE CHAR( 30) COLLATE UTF8,
PORDER INTEGER,
SONGNUM INTEGER,
MAINKEY BIGINT,
KEYFIELD BIGINT NOT NULL,
CONSTRAINT PK_PLAYLISTS PRIMARY KEY (KEYFIELD)
)
A little trial and error turned up the fact that I can enter data in any column except the Artist and Title, when I enter data into those fields and try and move to another field I get the -303 error. This perplexes me since there are 104 other records in the database that have been added successfully without any problem and there is nothing strange or unusual about the text of the Artist and Title that I’m attempting to insert; I even tried just making either field a single character “a” and I get the same error. I’ve also discovered that I can’t edit any of the other 104 records; for example if I attempt to edit a record with an value of “Carlos Ortega” in the artist field and replace that with “a” and move to another field I get the same -303 error.
In case there was some damage to the database I’ve even tried a backup and restore and I still have the same problem on the restored database. I’ve tried using the Database Validation & Repair wizard and it simply says “No errors”.
Does anyone have some insight into this problem?
Thanks,
Chris LeFebvre