🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1402

Re: Arithmic error

#1402
From: Viatcheslav V. Vassiliev
Date: Thu, 08 Jul 2004 17:33
76 lines
3922 bytes
Really, it (MS SQL Server) is right. CupWeight numeric(6,4) is 6 digits
number and 4 of them are on the right of decimal point, so only 2 digits
before decimal point. 100 is overflow, 99 is not.

> out of curriosity, does MS SQL require you to insert NULLs on all feilds
in
> a table if you do an insert into only  on certain ones?
No, identity column is autogenerated.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"James Peterson" <jpeterson@romanmealmilling.com> �������/�������� �
�������� ���������: news:40ed62a6@newsgroups.borland.com...
> out of curriosity, does MS SQL require you to insert NULLs on all feilds
in
> a table if you do an insert into only  on certain ones?
> "James Peterson" <jpeterson@romanmealmilling.com> wrote in message
> news:40ed58d5$1@newsgroups.borland.com...
> > I have done it 182 and '182' and same error. and its MS SQL 2000
> >
> > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
> > news:40ed5516$2@newsgroups.borland.com...
> > > Write numeric as integer, not as string - 182, not '182'. What is your
> > DBMS?
> > >
> > > file://------------------------------------------
> > > Regards,
> > > Vassiliev V. V.
> > > http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> > > ADO.Net
> > > http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> > > MS Jet (Access) and Interbase (through OLEDB)
> > >
> > > "James Peterson" <jpeterson@romanmealmilling.com> �������/�������� �
> > > �������� ���������: news:40ed4c75$1@newsgroups.borland.com...
> > > > I am getting the following error when I do an insert into.
> > > > Arithmetic overflow error converting numeric to data type numeric
> > > >
> > > > my table is set up like this
> > > > Create Table data(
> > > > RecNumber int IDENTITY(1,1),
> > > > ItemNumber char(30),
> > > > CupWeight numeric(6,4),
> > > > Primary key(RecNumber))
> > > >
> > > > and my insert is the following
> > > >
> > > > instert into data(ItemNumber, CupWeight)values('itemnumber','182')
> > > >
> > > > if I just insert the item number it works fine but when I add the
> > > cupweight
> > > > I get the error. I have been doing some searches on the web but they
> all
> > > say
> > > > you get that error when you pass a value to large for the field. But
> as
> > > you
> > > > can see in this case my number I am passing into cupweight is not
> > > exceeding
> > > > the limits of the feild.
> > > >
> > > > any help would be greatfull.
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <40ed8580$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40ed4c75$1@newsgroups.borland.com> <40ed5516$2@newsgroups.borland.com> <40ed58d5$1@newsgroups.borland.com> <40ed62a6@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,334e5cafbfb3ec2c
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <40ed4c75$1@newsgroups.borland.com> <40ed5516$2@newsgroups.borland.com> <40ed58d5$1@newsgroups.borland.com> <40ed62a6@newsgroups.borland.com>
Subject: Re: Arithmic error
Date: Thu, 8 Jul 2004 21:33:56 +0400
Lines: 78
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 213.234.218.42
Message-ID: <40ed8580$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1089308032 213.234.218.42 (8 Jul 2004 10:33:52 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail