Welcome Guest, Not a member yet? Register   Sign In
database Truncate error
#1

[eluser]reghan[/eluser]
Hello I am having issues with my database/codeigniter program


there error I am getting is:

Error Number: 1265

Data truncated for column 'Day2_LostRevenue' at row 1

its when I try and submit a blank into the database.

its set up as follows:

type: float(9,2)
null: yes
default: null

is this happening because its trying to insert null into a column thats a float?

I am just not sure what to do. I would like to be able to insert nothing an have it blank if that makes sense.

Thanks in advance
#2

[eluser]InsiteFX[/eluser]
Set a default like 0.00
#3

[eluser]reghan[/eluser]
I have set a default:

Day1_LostRevenue float(9,2) Yes 0.00

it still gives me that error, I I cannot insert a blank.


Any other suggestions?

Thankyou!
#4

[eluser]InsiteFX[/eluser]
If you do not set it to anything the default will set it to 0.00
If you are dealing with money there should always be a default like 0.00

Change your default from null to 0.00
#5

[eluser]reghan[/eluser]
Thanks for the reply.

I have set the money column to

null = no
default = as defined: 0.00

and it still gives me the truncate error:

Error Number: 1265

Data truncated for column 'Day1_LostRevenue' at row 1
for the column that I have set the default to 0.00.

SO I am really unsure what the problem says. I totally agree with your answers, but its just not working.
#6

[eluser]reghan[/eluser]
ALTER TABLE `process` CHANGE `Day1_LostRevenue` `Day1_LostRevenue` FLOAT( 9, 2 ) NOT NULL DEFAULT '0.00'

this statement was sucessfull.
#7

[eluser]Aken[/eluser]
What is a "blank" that you're trying to insert?
#8

[eluser]InsiteFX[/eluser]
This is what I found for this error 1265




Theme © iAndrew 2016 - Forum software by © MyBB