Questions tagged [tinyint]

tinyint is one of the Exact number data types that use integer data.

Integer data from 0 through 255. Storage size is 1 byte.

Type    Storage     Minimum Value   Maximum Value
        (Bytes)   (Signed/Unsigned) (Signed/Unsigned)

TINYINT   1          -128             127

Reference

101 questions
0
votes
2 answers

float vs smallint vs decimal in mysql

Now I have a table with impressions, clicks and ctr. I was wondering if I should use tinyint(1) and store ctr which has a range from 1-250 or should I store it as a float which has more precision. or maybe decimal. For statistics I would be…
Vish
  • 4,508
  • 10
  • 42
  • 74
0
votes
2 answers

returning the name of the column with the boolean value 0

I want to query the table below as to return the titles of the column where the intersection of SessionId and Roomx is 0.The type of the Room is TINYINT - which in mysql represents BOOLEAN Below is the table: SessionId Room1 Room2 Room3 …
watkib
  • 347
  • 3
  • 11
  • 25
0
votes
1 answer

Mapping tinyint(3) in a mysql database from Java Spring Boot

I am using a legacy codebase for refactoring an SMS gateway that comprises of a tinyint(3) column called "delivery_status" in the "m_outbound_messages" table in the mysql database. This column records the status of the message submitted to the SMS…
Usman Khaliq
  • 363
  • 3
  • 22
0
votes
1 answer

TINYINT column values switch to true and 1

I have been facing this weird issue where a table column is TINYINT. When I query the table on my local I get records with column values as true or false. I put code on production and it gets true or false values sometimes. But all of a sudden the…
Radhika
  • 2,453
  • 2
  • 23
  • 28
0
votes
0 answers

JAVA - Parse a string represneting a signed tinyint (0-255) to a byte?

I understand that java uses two's complement to represent a byte type. However is there an easy way to parse a string representing numbers in range of 0-255 into a byte? E.g. I expect the following code to be able to parse values (218,230,etc.)…
Y.S
  • 1,860
  • 3
  • 17
  • 30
0
votes
1 answer

Not able to update tinyint field

Hi I am not able to update msgFromUserFlag in database through hibernate. Neither i am getting any error while updating this value. This is my code at DAO layer. and in database my field is of TINYINT(1) type and in persistence class it is of type…
0
votes
0 answers

php switches my tinyint value

Im new to php and with working with mysql. I have table with users information: databse In login I get execute query, get all information: my php $query = "SELECT * FROM `users` WHERE `username` = '$username' AND `password` = '$password'"; …
Dona Tas
  • 3
  • 1
  • 3
0
votes
1 answer

MySQL inputting TINYINT syntax

I created TINYINT columns in my MySQL database to interpret boolean variables, which based on whether checkboxes are checked or not in the html store the values (0 for false, everything else for true) in the DB. But it won't update the values when…
AndrewY
  • 43
  • 2
  • 8
0
votes
1 answer

Dapper issue with tiny int

I am trying to migrate a database from MySQL to SQLServer using Dapper. Almost everything is ok except with TinyInt fields. Whatever the type I specify in my C# code, Dapper systematically throws an exception: {"Error parsing column 18…
E.Brudy
  • 23
  • 7
0
votes
1 answer

How can TINYINT store strings value on MySQL

So i'm quite new to database structure. And currently i need to build a notifications system for my web application. After googling for awhile i find the first answer is interesting. Why activity_type is TINYINT? Doesn't it suppose to be string…
Terry Tan
  • 421
  • 5
  • 12
0
votes
2 answers

Hibernate - MySql, Tinyint column

I'm trying to map a tinyint(1) column in Hibernate. For requirements, I need to save value "2" in the column but I can't change the sql type of it. If I declare it as an Integer in my class the hibernate validation fail. How can I get validation…
vjok
  • 33
  • 1
  • 9
0
votes
0 answers

MySQL: why is 'true' saved as 0?

I have a DB in MySQL where a column of my table is a boolean: `eligibilityDate` tinyint(1) NOT NULL Data arrive from my iOS Swift app through the following functions: let postParams =…
SagittariusA
  • 5,289
  • 15
  • 73
  • 127
0
votes
0 answers

mysql recover backup error on data with tinyint(1)

I've a mysterious problems and i'm asking you a little help. When i recover a db from r1soft all the data > 1 contained in a table with tinyint(1) is converted to 1 example: mytable_user +----+-------+--------------------+ | ID | data1 | data2…
Armauz
  • 1
  • 3
0
votes
1 answer

MySQL error store boolean value into tinyint

Class Code this is some of code from Class Code that may help. private ResultSet rs; private Connection cn; private Statement st; public void insertData(String data) { try { st.executeUpdate(data); { …
Denni S
  • 134
  • 1
  • 15
0
votes
1 answer

Tinyint in MySQL Results Returning Wrong Values

I have a table with about 50k records. Each record is associated with an activation code and a tinyint(1) that is either a 1 or a 0 depending on if it has been activated or not. I wrote this script to search activation codes: $count = 1; foreach…
Jeff Thomas
  • 4,728
  • 11
  • 38
  • 57