Data truncation
Encyclopedia
In database
s and computer networking data truncation occurs when data
or a data stream
(such as a file
) is stored in a location too short to hold its entire length. Data truncation may occur automatically, such as when a long string
is written to a smaller buffer, or deliberately, when only a portion of the data is wanted.
Depending on what type of data validation
a program or operating system has, the data may be truncated silently (i.e., without informing the user), or the user may be given an error message
.
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...
s and computer networking data truncation occurs when data
Data (computing)
In computer science, data is information in a form suitable for use with a computer. Data is often distinguished from programs. A program is a sequence of instructions that detail a task for the computer to perform...
or a data stream
Data stream
In telecommunications and computing, a data stream is a sequence of digitally encoded coherent signals used to transmit or receive information that is in the process of being transmitted....
(such as a file
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...
) is stored in a location too short to hold its entire length. Data truncation may occur automatically, such as when a long string
String (computer science)
In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set or alphabet....
is written to a smaller buffer, or deliberately, when only a portion of the data is wanted.
Depending on what type of data validation
Data validation
In computer science, data validation is the process of ensuring that a program operates on clean, correct and useful data. It uses routines, often called "validation rules" or "check routines", that check for correctness, meaningfulness, and security of data that are input to the system...
a program or operating system has, the data may be truncated silently (i.e., without informing the user), or the user may be given an error message
Error message
An error message is information displayed when an unexpected condition occurs, usually on a computer or other device. On modern operating systems with graphical user interfaces, error messages are often displayed using dialog boxes...
.
See also
- Fixed-point arithmetic -> Precision loss and overflow
- Data lossData lossData loss is an error condition in information systems in which information is destroyed by failures or neglect in storage, transmission, or processing. Information systems implement backup and disaster recovery equipment and processes to prevent data loss or restore lost data.Data loss is...