Board index » delphi » IBSQL + EIBInterBaseError (table definition problem?)

IBSQL + EIBInterBaseError (table definition problem?)

I know this is probably not 100% the right group but I'll post it here.

I use a TIBSQL to write some data in my IB6-DB:

insert into Positionen
(Belegnummer,Belegposition,Alternativnummer,Positionsnummer,Artikelquelle,Po
sitionstext,Einzelpreis,Menge,Gesamtpreis) values (
 '18727448',
 '0',
 '0',
 '',
 'aus Artikelstamm',
 'sadfsaf',
 5235.0,
 43.0,
 225105.0);

The definition of the table Positionen is the following:

create domain TID as VarChar(16) not null;
create domain TBoolean as Char(1) not null check (value in ('J','N'));
create domain TTextBlob as blob sub_type text;
create domain TArtikelquelle as VarChar(11) not null check (value in
('FromStock', 'Order', 'Manual', 'ManualOrder', 'Text'));

create table Positionen (
  Belegnummer                          TID,
  Belegposition                        integer not null,
  Alternativnummer                     integer not null,
  Positionsnummer                      TID,
  Artikelquelle                        TArtikelquelle,
  Positionstext                        VarChar(100),
  Positionsbeschreibung                TTextBlob,
  Einzelpreis                          numeric(8,3),
  Menge                                numeric(12,5),
  Gesamtpreis                          numeric(8,3),
  constraint pk_BelegPosition primary key (Belegnummer, Belegposition,
Alternativnummer),
  constraint fk_BelegPosition foreign key (Belegnummer) references
Belege(Belegnummer) on update cascade on delete cascade
);

But when I try to do IBSQL.ExecQuery; I get the following EIBInterBaseError:
"arithmetic exception, numeric overflow, or string truncation".

Any hints or suggestions?

TIA,
Helge.

 

Re:IBSQL + EIBInterBaseError (table definition problem?)


You have Belegposition,Alternativnummer both defined as integer but you are
passing '0' as the values which is a string not a number.

Quote
Helge Jung wrote:

> I know this is probably not 100% the right group but I'll post it here.

> I use a TIBSQL to write some data in my IB6-DB:

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:IBSQL + EIBInterBaseError (table definition problem?)


Quote
> You have Belegposition,Alternativnummer both defined as integer but you
are
> passing '0' as the values which is a string not a number.

Thanks for you quick reply. Stupid beginner error...

But after I changed that I still have the error. I'm living in Germany and
the DecimalSeparator is "," and not "." ... could that make the trouble? But
if I'd use "," I would conflict with the separation of the values, wouldn't
I?

Helge.

Re:IBSQL + EIBInterBaseError (table definition problem?)


Quote
> But after I changed that I still have the error.

This is the new statement:

insert into Positionen
(Belegnummer,Belegposition,Alternativnummer,Positionsnummer,Artikelquelle,Po
sitionstext,Einzelpreis,Menge,Gesamtpreis) values (
 '21471494',
 0,
 0,
 '',
 'manuelle Eingabe',
 'Test-Position',
 4.32,
 5.0,
 21.60);

The statement is automatically generated from variables but that shouldn't
be the problem...

Where am I missing something???

Helge.

Re:IBSQL + EIBInterBaseError (table definition problem?)


Hello:
I think the problem might be that the field Artikelquelle is defined as
VarChar 11 and you are sending it a string greater that 11 characters.  This
would give you a string truncation error.

Trac

Quote
"Helge Jung" <he...@eco-logic-software.de> wrote in message

news:3b8e8e60_1@dnews...
Quote
> I know this is probably not 100% the right group but I'll post it here.

> I use a TIBSQL to write some data in my IB6-DB:

> insert into Positionen

(Belegnummer,Belegposition,Alternativnummer,Positionsnummer,Artikelquelle,Po
Quote
> sitionstext,Einzelpreis,Menge,Gesamtpreis) values (
>  '18727448',
>  '0',
>  '0',
>  '',
>  'aus Artikelstamm',
>  'sadfsaf',
>  5235.0,
>  43.0,
>  225105.0);

> The definition of the table Positionen is the following:

> create domain TID as VarChar(16) not null;
> create domain TBoolean as Char(1) not null check (value in ('J','N'));
> create domain TTextBlob as blob sub_type text;
> create domain TArtikelquelle as VarChar(11) not null check (value in
> ('FromStock', 'Order', 'Manual', 'ManualOrder', 'Text'));

> create table Positionen (
>   Belegnummer                          TID,
>   Belegposition                        integer not null,
>   Alternativnummer                     integer not null,
>   Positionsnummer                      TID,
>   Artikelquelle                        TArtikelquelle,
>   Positionstext                        VarChar(100),
>   Positionsbeschreibung                TTextBlob,
>   Einzelpreis                          numeric(8,3),
>   Menge                                numeric(12,5),
>   Gesamtpreis                          numeric(8,3),
>   constraint pk_BelegPosition primary key (Belegnummer, Belegposition,
> Alternativnummer),
>   constraint fk_BelegPosition foreign key (Belegnummer) references
> Belege(Belegnummer) on update cascade on delete cascade
> );

> But when I try to do IBSQL.ExecQuery; I get the following
EIBInterBaseError:
> "arithmetic exception, numeric overflow, or string truncation".

> Any hints or suggestions?

> TIA,
> Helge.

Re:IBSQL + EIBInterBaseError (table definition problem?)


Quote
> I think the problem might be that the field Artikelquelle is defined as
> VarChar 11 and you are sending it a string greater that 11 characters.
This
> would give you a string truncation error.

Damned! Stupid! Please wait until I've finished banging my head against the
wall...

Thanks for the hint... thanks a lot...

Helge.

Other Threads