Specifies the type of data being stored (string, date, numeric, etc).

learn more… | top users | synonyms

0
votes
2answers
316 views

change column type from string to numeric

so I have a table with 5.2 million records. 3 columns in this table are for salaries. Those column are currently stored as string and I'd like to change the data type to numeric (I understood while ...
0
votes
2answers
234 views

Why is Oracle's number datatype so HUGE? and why do I seem to have no alternatives?

Oracle has a favorite numerical class called NUMBER. It is a 22 byte value that just seems ludicrous in an index. I have some values that would easily fit in a 6 byte integer and would therefore fit ...
0
votes
2answers
33 views

General Database Optimizations - correct data types - why to avoid NULL? [closed]

Oracle recommends: Choose the correct data types and size to: – Avoid NULLs – Improve performance – Protect data – Use data compression where appropriate I don't understand why I need to avoid ...
0
votes
1answer
299 views

12 hour format time in SQL datatype

I can convert time datatype to 12 hour format using convert etc. But is there any option to save the time in 12 hour format in SQL tables using any settings or property or any other methods?
0
votes
2answers
178 views

looping through a table type variable

I have a function that has one parameter of a table type, i want to loop through all the fields and return the column that has a null or empty value. CREATE OR REPLACE FUNCTION toned....
0
votes
1answer
23 views

Unsigned Int datatypes

Does Microsoft SQL Server support unsigned integer data types? I am trying to learn a bit more about the data type choices and helping a friend in his database project, I know that MySQL does.
0
votes
1answer
34 views

Working with PostgreSQL information_schema and tables (with same names, in different schemas) whose names start with a number

I'm needing to work with tables whose names start with numbers. For example, in the crs_1973 schema there is a table called 2015_04_21. I know that when the table name is made up of numbers, I must ...
0
votes
1answer
3k views

Storing latitude and longitude

I know there are similar questions on here that have been answered but unfortunately none of them work for me. I am hacking my way through creating a page which will display multiple locations on a ...
0
votes
1answer
405 views

Inheritance discriminator column better int or varchar or enum?

What is the best practice for storing a discriminator column ? Does it make any difference ? Any pros/cons of using one over the other ? I am using MySql with Entity Framework but the question goes ...
0
votes
1answer
56 views

What kind of data type to use for numbering in the Harmonized System?

The harmonized system uses a numbering that shows the hierarchy between different items. Similar to bookkeeping ledger numbers. Here is an example: 01 LIVE ANIMALS 0103 swine, live 010310 Purebred ...
0
votes
1answer
2k views

Why does Oracle store time in DATE column?

I have a table with a date column. I used JDBC to save a java.util.Date object into the table. When I run following query I get date aswell as a time value: select To_CHAR(departure_date,'DD-MM-YYYY ...
0
votes
4answers
888 views

Writing SQL statement in sqlcmd to hide the milliseconds for column type of time

I have a table called testtable that have a column named expire_time of type [time] The problem is that when I type the following in sqlcmd: select * from testtable It will return the following: =...
0
votes
1answer
42 views

Storing mail in database, data type

I've found pretty poor informations about mail databases. My need is to archive mail messages downloaded from a normal pop3 or imap account: I am an ordinary user and I do not own the server, but ...
0
votes
1answer
152 views

DECIMAL and NUMERIC datatype in Postgres [closed]

what is the use of decimal and numeric datatype in postgreSQL. As per the reference the following is the explanation given to these datatypes. decimal,numeric --> It is a user specified precision,...
0
votes
1answer
267 views

Teradata sql syntax from date to quarter

Need a Teradata sql syntax to extract quarter from a date. Given below is the expected output Date: (YYYY-MM-DD) 2015-09-12 2015-05-22 2014-12-15 Output 3Q15 2Q15 4Q14 Query which I have ...
0
votes
1answer
216 views

Storing variable length arrays of doubles in MySQL without loss of information

I am trying to store variable length arrays of C++ doubles into a MySQL database. I was initially storing each value in the array as a row of the form: `pv_name` varchar(60) NOT NULL, `time_stamp` ...
0
votes
1answer
44 views

Array of strings when updating a field

Unintentionally discovered that following query works in PostgreSQL: UPDATE "sometable" SET "somefield" = ('string1', 'string2') WHERE "id" = 1; I'm passing an array of strings to field and the ...
0
votes
1answer
39 views

SQLite Data Types In Context of Disk Space

I would like to better understand which data types in SQLite take up more disk space. I've looked through official documentation but could not find anything in context of storage space. Any guide ...
0
votes
1answer
668 views

Do I lose data if I change from INT to TINYINT

I have a database (Engine InnoDB) that was setup by someone else. I noticed that one column contains data between 1 and 107 at this moment, and it is highly unlikely to further increase much. As it ...
0
votes
1answer
90 views

In a banking organization, why would account balance be declared as varchar and not decimal?

I worked in two organizations where I found money related columns are defined as VARCHAR data type. I didn't get correct explanation from anyone. As the database team is totally isolated with our team....
0
votes
1answer
177 views

Best datatype to store betting odds? [closed]

I have a lot of soccer betting odds (hundreds per match and thousands of matches), for example: <_10Bet_Home_Home>8.00</_10Bet_Home_Home> <_10Bet_Home_Away>1.39</_10Bet_Home_Away&...
0
votes
1answer
250 views

Why does mysql give different result for this summations? [duplicate]

Can someone help understand the following behavior? mysql> select (1/3 + 1/3 + 1/3); +-------------------+ | (1/3 + 1/3 + 1/3) | +-------------------+ | 1.0000 | +-------------------+ ...
0
votes
1answer
447 views

Initializing values to a custom data type

I have defined a custom data type which I need to use in my procedure. Give below is my data type. CREATE or REPLACE TYPE CUSTOM_DATATYPE AS object( chkinvpre VARCHAR2(100), orderid NUMBER(10)...
0
votes
1answer
1k views

Oracle - how to reference to a field%TYPE using database links?

I have this database which includes a couple of schemas. Say I need to access schemaONE from schemaTWO. To do this, I have created a database link named "DB_ONE_LINK". I am able to access to ...
0
votes
2answers
544 views

Should numeric identifiers like serial numbers be stored as integers?

Many of our databases store numeric tracking codes (like serial numbers) as integers. There is little chance of these codes every getting alphabetic characters, but it still seems like an incorrect ...
0
votes
1answer
984 views

timeout on updating nvarchar(max) after converting datatype

I recently Upgraded to 2008 Enterprise and took the opportunity to change the biggest table in my db with the maintenance window. ran the following to change my ntext field ALTER TABLE ...
0
votes
1answer
50 views

Does a numeric field always use the same disk space?

When you have a numeric field in MySQL(MYISAM) (E.g. Integer) will it always use the same disk space, no matter what number is actually stored?
0
votes
1answer
638 views

What are commonly used database types? [closed]

There are a lot of database types. Can you list a list of the top classification of databases commonly found in schools and offices? Any help is appreciated. Hope to see compressed and summarized type ...
0
votes
1answer
16 views

SQLite function to specify exactly how the data is stored internally

I have used the typeof() function within SQLite before (http://sqlfiddle.com/#!7/fcf0e/1), but I would like to go a little further this time. I know that INTEGER can be stored internally as 1, 2, 3, ...
0
votes
0answers
20 views

Should SQLite Datatypes ever be seen as a Source of Truth?

I have been working with a library on Android (user, not developer of the library) that will take SQLite syntax and convert it into type-safe Java Models that is based on the types provided in the ...
0
votes
0answers
45 views

Oracle 12c cannot start up after having failed to enable Extended Data Types

I upgraded my single instance oracle to 12c on CentOS 6.7 for the benefit of having 32767 bytes varchar2 and I followed below nice article until stopped half way when executing utl32k.sql script. ...
0
votes
0answers
19 views

SQLite text columns

When having a table in SQLite that has a TEXT data type, is there any implication if the length of the contained string differ significantly?
0
votes
1answer
56 views

In Rails: How is existing data affected by data type change?

I'm working on a Rails app and would like to change the datatype for an existing column. It's currently a DateTime type, and I want to change it to a Date type. I found a way to do this here, but in ...
0
votes
2answers
34 views

Excel Import ID, Data Type Double

I get a file from another department that contains an id column. The id column is mostly numbers, but also contains some letters. I receive the file in XLS format. When I try to use the import ...
0
votes
0answers
42 views

MySQL: SELECT (column == 'value') return result of type “LONGLONG” instead of BOOL

When I do SELECT (column1 == 1) FROM table1 AS isOne; I'd expect to have a result set with a column of type BOOL, a.k.a. TINYINT(1). Unfortunately, I receive a "LONGLONG". Here's an experiment. ...
0
votes
0answers
71 views

force SQLite view column type affinity

Using SQLite 3, I have some view columns which are defined with an expression, and so have no type affinity. Is it possible to define them in a way that forces them to have a certain type affinity? ...
0
votes
0answers
444 views

varchar() vs TEXT with utf8 encoding character length limit

I'm building a huge dashboard for a big website. And I'm now in the phase of creating the database and it is very very big with a lot of relations. So I want to build something that doesn't consume ...
0
votes
0answers
16 views

How to use Domains in oracle database

I am trying to learn about domains. As far as i understand, domains are user defined "types" that describe restrictions of its value. But how would i assign and use a domain in a given table in an ...
0
votes
0answers
220 views

Decimal Data Type as Primary Key

One of my tables is set up like this: create table dbo.Source ( testID decimal (10,3) PRIMARY KEY , column 2 somedatatype , column 3 somedatatype ) Whenever I perform SSIS into this table ...
0
votes
0answers
1k views

Blob datatype issue with log file

I am getting continuously below error message in mysqld.log [ERROR] InnoDB: The total blob data length (10152274) is greater than 10% of the redo log file size (3072). Please increase ...
0
votes
0answers
517 views

Suppressing the removal of trailing zeros in numeric data type in sql server

I initially declared the data type of the columns for some of the tables i am working on as "NUMERIC". cause of that, trailing zeros are being removed. Is there anyway to suppress this behavior? i ...
0
votes
1answer
2k views

What is the difference between int(8) and int(5) in mysql? [duplicate]

I found out, that if you have a field defined as INT(8) without ZEROFILL it will behave exactly as INT(5) in both cases the maximum value is −2,147,483,648 to 2,147,483,647, from −(2^31) to 2^31 − 1 ...
-1
votes
1answer
572 views

Recommended datatype fixed length in mysql

What's the best data type for store fix length data such as MD5 password 1f3870be274f6c49b3e31a0c6728957f HEX Ccolor f2a709 They don't need character sets. All in absolute [a-z0-9]{6} for color, [...
-1
votes
1answer
990 views

Multiple conditions in a derived column ssis

Hi I am trying fairly new to SSIS , and my task is to convert dates in string as given below to a datetime. These are my date of birth in the source file (string data type): Source date of birth (...
-3
votes
1answer
67 views

Why do we have Geometric Datatypes in SQL databases? [closed]

What is the purpose of a specific SDI datatypes in SQL tables? They could be represented as "(3,1)" (in case of point on a plane) VARCHAR and then retrieved by the application and processes them? What ...
-3
votes
1answer
7k views

What are performance benefits when using number type instead of using char/varchar?

From various posts, I have summarized about using number type instead of char/varchar for PK: If you choose char/varchar type for PK and your values are short (just some alpha numberic codes) then it ...
-4
votes
1answer
55 views

How does Oracle handle types in this UNION query? [closed]

SELECT 1 FROM DUAL UNION SELECT '2' FROM DUAL; what does this give? knowing dual is default table and is a single row table. update: I fixed it with SELECT 1 FROM DUAL UNION SELECT CAST( '2' ...