If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Export to SQL text using decimal 8,2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-27-09, 14:07
oldnickj oldnickj is offline
Registered User
 
Join Date: Jan 2009
Posts: 103
Export to SQL text using decimal 8,2

Working on a MAC 10.6 using Cocamysql:

I have a table field definition of decimal and the length set to 8,2 to save currency amounts. Works great in the datbas but when I export the text file has "3235302E3030" for an amount of "250.00" when I reload the text file is shows "999999.99.

What happened?
Reply With Quote
  #2 (permalink)  
Old 10-27-09, 15:13
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by oldnickj
What happened?
3235302E3030 ~is~ 250.00

you seem to be displaying hex

try using the CAST function in your query

(i'm guessing, on account of i can't see your query)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-27-09, 15:31
oldnickj oldnickj is offline
Registered User
 
Join Date: Jan 2009
Posts: 103
CocaMYSql has a hidden function it uses to build the export file. I'm just usingthe Export and import functions.
Reply With Quote
  #4 (permalink)  
Old 10-28-09, 17:30
oldnickj oldnickj is offline
Registered User
 
Join Date: Jan 2009
Posts: 103
CoacaMYSQL has been replaced by Sequel Pro which does not make the same mistake.

Ah well... not my fault...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On