On 04-04-2020 10:49, 'Stellarancia.com' [email protected] [firebird-support] wrote: > He, > I've an error that I don't undestrand. > I use Delphi 7 environment to create my applications, Zeos components > for connections and Firebird 2.5 Superserver for database management. > To register the data, my App uses the processor component; the > Connection.Autocommit parameter is set to False. > My App inserts numerous lines of data to be recorded in the Process > component (with Process.Script.Add('...') -> 'UPDATE XY SET...'; INSERT > INTO ZXD...'; UPDATE FGH SET ...'; and so on); > at the end, it adds the command "COMMIT;", then call "PARSE", and "EXECUTE". > The lines 4 and 5 of the processor script contains the data mistaken, > but I don't undestand where is the eror. > The exception raised by the server is: > ----------- > > SQL Error: conversion error from string "". Error Code: -413. Overflow > occurred during data type conversion. > The SQL: INSERT INTO ANA_DIPE_PRESORD (COD_REC, MATR, DATORE, POSIZ, > MESE, ANNO) > VALUES (30030003004601, 3, 46, 1, 03, 2020) > ; > > ---------- > This is the table declaration: > ---------- > > CREATE TABLE ANA_DIPE_PRESORD > ( > COD_REC Bigint NOT NULL, > ANNO Smallint DEFAULT 0, > MESE Smallint DEFAULT 0, > MATR Smallint DEFAULT 0, > DATORE Smallint DEFAULT 0, > POSIZ Smallint DEFAULT 0, > STATO Char(1) DEFAULT '' > CONSTRAINT PK_DIPPPREORD > PRIMARY KEY (COD_REC) > ); > > CREATE UNIQUE INDEX IND_ANADPPREORD_COD ON ANA_DIPE_PRESORD (COD_REC); > GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE > ON ANA_DIPE_PRESORD TO SYSDBA WITH GRANT OPTION; > > ---------- > > The Table has no trigger, no generators, no stored procedures connected. > The data in "COD_REC" must be unique. > > No data are sent as '' (void string), neither any value is sent as > "Quoted string", > because they are all of type smallint (and bigint). > I'm going crazy. > It's stupid, but I've changed the value for field 'MESE' from '03' to > '3', but the result is the same. > What can be the reason? > Thanks for reply.
Do you have a trigger on the table? Given the STATO column has a default of '', maybe a trigger tries to convert that to a number somewhere? Also, are you absolutely sure this is the statement that causes the problem. Your trying to execute a script, which Firebird itself does not support, so your component is doing some transformations, which might mean that the error is not on the line that you think it is. Try executing a single statement instead of a script. I'd recommend trying to reproduce it in ISQL, and if possible provide us with a minimum reproducible example Mark -- Mark Rotteveel
