SQL export data


I have data imported from excel file into mathematica but mathematica automatically converts large number into scientific form and when transferring this data to sql string field i get the following ...e+... nonsense.


I tried using $PrePrint=NumberForm[#,ExponentFunction->(Null&)]& which fixes the problem when working in mathematica but data going into sql still contains e. Please help i need to get this fixed on an urgent basis.

Is there a way to tell mathematica to never use e or any exponentiation internally as well?


Posted 2017-11-29T07:00:50.417

Reputation: 7 041

If I remember correctly from when I used "DatabaseLink`" you can pass a string to a string field. Is that right? If so try pre-generating your strings (i.e. with ToString). – b3m2a1 – 2017-11-29T07:22:52.013

I am importing from excel using ExcelLink package. So for example i have a number 234234822342351. coming from Excel (Excel internally keeps all numbers as floating point even those appearing as integer). If i apply ToString[234234822342351.] i don't get integer. So the question is can mathematica determine if a number is integer by looking at decimal digits? – user13892 – 2017-11-29T07:41:23.337

Definitely doable via multiple methods. Try Round[intList, 10^-17] or searching on this site. – b3m2a1 – 2017-11-29T07:44:59.433

It sounds as if you are converting numbers to strings to insert into a SQL database. You don't need to do that. May you include a bit of code where you are inserting the value into the database. There is a more robust method of inserting into SQL. – Edmund – 2017-11-29T17:00:54.277

No answers