473,598 Members | 3,409 Online
Bytes | Software Development & Data Engineering Community
+ 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 1196
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
2517
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 day long. But when I go to insert I get this error. No value given for one or more required parameters. Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters. Source Error:
1
1054
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 insert sql statement was working fine before. I had checked the data size against the field size. the
3
1567
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() strSql="insert into table1(column1) values('test1')" cmd = New OdbcCommand(strSql, con)
3
5700
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 Unexpected error from external database driver (15877). What is wrong?
5
3728
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 value NULL into column 'geid', table 'general'; column does not allow nulls. INSERT fails. ....not sure how to include the 'geid' field into the scheme.
2
1705
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 perfectly when i am trying it in my localhost. The error is getting when I tried it with my hosting server. System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'Dr_no', table 'myDB.username.tablename'; column does not...
0
1633
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 directly run in as/400 without any error. Im using i series client access ODBC driver to connect the database. ERROR SQL7008 - INP35 in OSLD1F3 not valid for operation. Can anyone help me. Thank You
4
28075
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 varchar with length 10. Can anyone help regarding this??
13
32680
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 'date' at row 1 I have done some researching and I believe the problem is to do with the data that is being sent by my cfqueryparam function. Here is my create function:
9
7477
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 selection form for setting up MS Word mailings to groups of contacts, normally between two dates. The query on the MailShot form selects Name and address etc. from the 'Contacts' table according to the settings on the MailShot form and contains the field...
0
7902
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8395
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8050
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3898
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2412
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 we have to send another system
0
1250
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.