Page 1 of 1

INSERT INTO MySQL (Decimal 10,4) - ???

Posted: Wed Nov 05, 2014 5:33 pm
by AxWald
Hi,

Assume it just another brain block - I need to insert/ update/ upsert data into a MySQL database, and having a field there that is formatted [Decimal 10,4] makes me trouble.
I keep getting errors of this field, I have tried all possible ways of numberformat and format now, but it still doesn't want to work.

So, assuming I have 10.5 (ten and a half) as value, how would I write it in my "VALUES" section of the SQL String to get it through?

I'm sure one one the wizards here will laugh now loudly, and solve my problem with a 1-liner - Thx a lot for it, my brain seems blocked for now!

Thx, and have fun!

Re: INSERT INTO MySQL (Decimal 10,4) - ???

Posted: Tue Nov 25, 2014 11:10 am
by Mark
Hi,

I have a feeling that the problem isn't related to the number of the SQL field. What is the complete text of the error messages you get?

Mark

Re: INSERT INTO MySQL (Decimal 10,4) - ???

Posted: Wed Nov 26, 2014 10:04 pm
by AxWald
Mark,

I have to excuse. After I posted my question I went on to other problems, and got overwhelmed by those.
Now, that those other problems slowly start to rot on the battlefield of code (= I solved them), I found time to come back here.

To be honest, no idea anymore what error is thrown when I try to insert. I'll add this information asap.

Just to clarify, the MySQL has a field defined as [Decimal 10,4]. My idea was to feed it with '10.5000' thus in the VALUES section of the SQL string-to-built (for 10 and a half). As far as I remember this (and any other tries) failed in any possible variety, so my question.

I had hoped that someone else would recognize the problem ("Yeah, inserting decimals into MySQL, what a madness!") and would show me the proper syntax to write my 10 & a half within the VALUES section of an INSERT SQL string properly ...

Now it's the time to start working with this again, so I'll provide the proper error messages.

Thx a lot for your help!

Have fun!