473,480 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to deal with error of data truncated for a column when i insert some records int

1 New Member
I created table in the database called category where I record prices and I have a column of total . when I insert data in my application source code I cannot include total which is in the database ... how can I be able to insert without including the total that I want to count the total from the list of prices
Sep 28 '15 #1
1 1193
chaarmann
785 Recognized Expert Contributor
Maybe just sum up all prices in a Java-loop?

But I would still try to get the total from the database for consistency reason, maybe they use different rounding etc..

In SQL you could use sum(a) to get the sum of all prices in column a, but then again, if it's soewhere already calculated, use that instead (consistency). Headword: island of data.
Sep 28 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2510
by: Cedric Robinson via .NET 247 | last post by:
(Type your message here) -------------------------------- From: Cedric Robinson Hi, I am simply trying to insert records into an access database using asp.net. I can edit and update tables all...
1
1049
by: Mike John | last post by:
I am receiving the following error when insert into the table. "String or binary data would be truncated. The statement has been terminated." the following error had occured recently the...
3
1564
by: Reddy | last post by:
Hi, I need to insert records into two tables another after the other. Is the following code ok or is there a more efficient way of doing this using sqlcommand object con.Open() ...
3
5682
by: Dave | last post by:
I'm writing a c# Windows program that needs to be able to insert records into a dbase table. I can read it using a dataset but can't insert records. I receive the following error, ERROR ...
5
3720
by: .Net Sports | last post by:
I'm trying to insert records into an sql database coming from a page using the request ..form method. The table "general" has a primary key 'geid .' I get the following error: Cannot insert the...
2
1697
ak1dnar
by: ak1dnar | last post by:
Hi, I am getting some sql errors when trying to insert a record to mysql table using asp.net application. Let me explain the scenario for your reference. This asp.net web form is executing...
0
1628
by: hasankacd | last post by:
hi, Im using vb.net programme with db2. when I insert a record the following error comes even update the record. But I can retrieve the data with out any problem. But the particular query can...
4
28010
by: bsonline | last post by:
Hi all, When I update a table by sql qry, I am getting a error like "java.sql.SQLException: Data truncated for column at row 1" . I use mysql 4.1 for my application. this particular column is in...
13
32647
by: chromis | last post by:
Hi, I have a query which updates the projects table of my database, however when I try to run my query with blank values i get the following error: Data truncation: Data truncated for column...
9
7468
by: AndyWal6 | last post by:
I have an Events table that records events with the fields: , , (Text), and it is used as a note pad to record calls made to and from contacts and other occurrences. I also have a MailShot...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7045
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.