0
Is there a problem saving data with commas or dot (.) in my database (SQL Developer)? Which is the most appropriate variable to declare for currency type fields (price)?
0
Is there a problem saving data with commas or dot (.) in my database (SQL Developer)? Which is the most appropriate variable to declare for currency type fields (price)?
3
You can write any data in the database, depending on what you want.
The most correct type of column for storing money is a NUMBER
with fixed houses (there are alternatives). Example:
NUMBER(19, 4)
This allows 19 digits with 4 in the decimal part.
OK . One more question. I made some Serts, and I realized that if I put 22.00; it "excludes" the two zeros, getting 22. Is it normal? Is there any way to avoid it?
It depends on what you did, but if you’re trying to save money, it’s not normal, you must have done something wrong. Maybe the problem is the comma. has to be point. even so both will store 22, nothing else, the presentation can be done in several ways, the problem may be there.
Okay. One last question (sorry to be abusing). In my project c#, I save the price fields with the comma, however, it sends to the bank without the comma. I have to make some kind of statement?
It’s hard to answer abstract things like that, I don’t really know what you’re asking. Ask a question giving details, showing what you’re doing, what you expect, what’s going wrong.
Okay, I’ll do and show the codes.
1
To declare currency type fields you better use a Decimal/Numeric so you can set the decimal places.
For the field with commas or dot you have to see the size of the field, if it is a larger text you should use a field of type Blob, if you cannot use a varchar. Only you should be very careful when it comes to accomplishing the queries.
Browser other questions tagged sql database oracle typing
You are not signed in. Login or sign up in order to post.
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site.
– Maniero