Jump to content
UBot Underground

Why are decimals dropped when inserted into Mysql table?


Recommended Posts

HI guys

I'm doing a simple insert into a database table from a ubot table using table cells.

In the ubot table I see 13.2 as an example.

Using set the insert statement is generated as seen two lines down.

When I run the insert into mySql table the decimal is dropped and the value is rounded down to 13.

#inset_record: INSERT INTO sometable
(
sometable.profileid,
sometable.theme_keywords,
sometable.ID,
sometable.Flag,
sometable.kwSource,
sometable.LARI,
sometable.PPC_CostclickMonthly,
sometable.PPC_clickMonthly,
sometable.TrafficForecast,
sometable.CompetingPages
)
VALUES
(
'5060',
'dysfunction',
'0000',
'xxxxxx',
'xxxxxxxx',
'100',
'13,2',
'12643,995',
'71769,96',
'13500000'
)

All decimals are being dropped.

Why is this happening?

The table in mysql is set to double.

 

Any help will be appreciated.

Link to post
Share on other sites

OK figured this one out

When you create the insert statement you must wrap the number with the FORMAT function

 

example

 

FORMAT(column_name,2)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...