MySQL Forums
Forum List  »  Newbie

Re: Uploading CSV. 0 records imported
Posted by: Ben Wade
Date: July 20, 2022 10:54AM

Ben Wade Wrote:
> 1)mysql80
> 2) https:// imgur. com/wzXyQzm
> 3) https:// imgur. com/TQPAfKN
> 4) https:// imgur. com/ib4cfJl
> Before using links remove spaces please.
> as you can see on the first screenshot. ther's an
> issue with decimal value. I put 15,5 it should be
> enough no? In total 15 digits, 10 before decimal
> comma and 5 after decimal comma.

I changed decimal to varchar for columns with currency and was able to insert the data. Also, I removed the primary key from the transaction ID because this column isn't unique and it was causing several issues(duplicate data weren't inserted).

The reason why I wanted to use decimal instead of varchar because these columns represent currency. And as I understood after googling, it is better to use decimal for money. I wanted to make it the right way but as we can see it brings up certain issues.
1) https:// imgur. com/GAHvcay as you can see here decimal type causes unnecessary zeros at the end of certain numbers.

2) https:// imgur. com/lCpDWWy but with varchar no issues.

Maybe you could tell me what datatype better to use and if you say that decimal is a better option then where did I make a mistake and how to fix decial datatype issue in my example?

Options: ReplyQuote

Written By
Re: Uploading CSV. 0 records imported
July 20, 2022 10:54AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.