November 6, 2001 at 8:20 am
We have dataflex-files which is to be loaded into some sql-server tables. There are some columns which holds different kind of prices.
The format in the dataflex-table columns is like 100,0000. When we're trying to load this into a column of the data-type decimal(10,2) something goes wrong. If the format instead was 100.0000 there would have been no problems. The problem is the comma-delimiter. What kind of datatype should we use?
AW
November 6, 2001 at 8:46 am
You should be able to set your DataFlex such that it exports its data in the 100.1234 format. Just run DFSETUP, and change it.
Take a backup of termlist.cfg (or dfini.cfg if you're on a newer DataFlex) before you start.
I have just converted a total of 23 million records in various tables into MS SQL7. It runs ok.
If you have any problems, write me, or visit the newsgroups at http://www.dataaccess.com.
Best regards
Henrik Staun Poulsen
Stovi Software
Denmark
November 6, 2001 at 11:05 am
That sounds like the best solution. You could always use an ActiveX conversion to cast the data into a decimal format, but it would probably be slower.
Steve Jones
December 8, 2002 at 6:18 pm
You can also do a 2-step: import the data into (var)char field, then use the REPLACE() function to strip out the commas while converting to your decimal field.
update imported
set decField = cast(replace(CharField, ',', '') as decimal(10,4))
December 8, 2002 at 6:20 pm
You can also do a 2-step: import the data into (var)char field, then use the REPLACE() function to strip out the commas while converting to your decimal field.
update imported
set decField = cast(replace(CharField, ',', '') as decimal(10,4))
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy