Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting Text Decimal to Table Error

Status
Not open for further replies.

TheLazyPig

Programmer
Sep 26, 2019
95
PH
Hi!

I'm going to import a record into the database.

RECORDS
Screenshot_2022-09-20_114207_nnwwqh.png


TABLE
Screenshot_2022-09-20_114347_n566rj.png


After I import I get this instead.

RESULT
Screenshot_2022-09-20_114650_cocjlf.png


The polno should be the same as records. How can I fix the inserted record?


Thank you!
 
How do you 'import a record into the database'? Do you use some build-in functionality, or do you write the code yourself?

And. how come POLNO is declared as VARCHAR2(50) instead of what it is, a NUMBER?

I guess 9.66671821 to the 7th power = 96667182.1

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
And as a second guess, I'd bet whatever you are displaying your results with is reformatting your number as scientific notation. Excel is notorious for doing this. Reformat the cell and the results will look the way you expect them too. And like Andy, I'm curious why you would cast your number as a varchar2 - especially if you expect a number as a result.
 
And like Andy, I'm curious why you would cast your number as a varchar2 - especially if you expect a number as a result."

I would offer a different perspective as a possibility. It depends on what the polno "number" is. Is this "number" an entity on which you will perform mathematical operations or is this "number" an identifier of some sort, like an invoice id or zip code or member id?

Where and what is RECORDS?

Are there other records that you have not displayed? Sometimes data base managers (systems) make decisions that you don't know about based on "guessing" about certain external data.

And also, was this column varchar BEFORE the data was imported?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!
 
I don't suppose it really matters why it's a varchar2 - it is what it is. But whatever is being used to display the results is interpreting it as a number and displaying it in scientific notation. The data is fine; the display is off. And the OP is not responding.
So it goes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top