[freetds] Attempt to convert data stopped by syntax error in sourcefield

chiang.tan at truenergy.com.au chiang.tan at truenergy.com.au
Sun Jul 30 19:37:30 EDT 2006

What I did was using DBD::Oracle to extract the data out from Oracle 8 
tables [Field Datatype: Number (15,5)]

Then use Sybase::BCP (Sypperl) to import that data into MSSQL 2000. [Field 
Datatype: [numeric (15, 5)]

I ran the script on Sun Solaris 2.8, using Perl 5.8.7, Sybperl 2.18, 
DBD::Oracle 1.17 and freeTDS 0.63

What I did to overcome this problem was, I did a TO_CHAR on oracle while 
extracting the data (since perl has no datatype), to force a leading zero.

I hope the information helps.

Chiang Tan

"James K. Lowden" <jklowden at freetds.org> 
Sent by: freetds-bounces at lists.ibiblio.org
30/07/2006 01:57 AM
Please respond to
FreeTDS Development Group <freetds at lists.ibiblio.org>

FreeTDS Development Group <freetds at lists.ibiblio.org>

Re: [freetds] Attempt to convert data stopped by syntax error in 

chiang.tan at truenergy.com.au wrote:
> The exaction of Oracle came back with numbers like .0123 (for number 
> 0.0123), and BCP is not happy with this format. What I need to do right 
> now is to fix this problem then BCP should work again

I just spent an hour looking into this.  What happens with ".0123" depends
on the datatype of the column being loaded.  For REAL/FLOAT, the string is
processed in tds_convert_char() by atof(3), which I would think would not
require a leading '0' (and shouldn't), but still might.  For other
datatypes, we of course have our own algorithms. 

Could you tell me what the column's datatype is?  If it's REAL or FLOAT,
I'd like to know what OS (and what version); if Linux, what version of
libc you have.  (I doubt the problem is there, but it's best to have all
the facts.) 



We're excited by gas & electricity.NOTICEThis email and any files transmitted with it may be confidential and are intended solely for the use of the individual or entity to whom they are addressed. Any confidentiality is not waived or lost because this email has been sent to you by mistake. This email may contain personal information of individuals, and be subject to Commonwealth and/or State privacy laws in Australia.This email is also subject to copyright. If you are not the intended recipient, you must not read, print, store, copy, forward or use this email for any reason, in accordance with privacy and copyright laws. If you have received this email in error, please notify the sender by return email, and delete this email from your inbox.The recipient should check this email and any attachments for the presence of viruses. We do not accept liability for any computer virus, data corruption, delay, interruption, unauthorized access or unauthorised amendment.TRUenergy Austra
 lia Pty Ltd ABN 96 071 611 017

Message  protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.

More information about the FreeTDS mailing list