|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 5/28/2008 4:48:02 PM
Posts: 1,
Visits: 3
|
|
I am uploading some SAS files into TD, trying to convert string to decimal.
I use
(case when myvar is null then -999 else cast( myvar as decimal(18,0)) ) as id
But TD gives me an error, saying the column might contains bad character. Why this happened?
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2 days ago @ 6:57:31 AM
Posts: 28,
Visits: 153
|
|
Is myvar column of varchar data type?
If myvar is varchar data type then you might get this error "bad character in format or data" with error code 2621.
This happens because, column being a varchar may contain character values also which cant be converted to decimal/integer by using cast. In this case you have to take care of char values in myvar column.
hope this solves your problem.
Please let know in case of wrong assumption.
Dhiraj P
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/12/2008 1:27:00 AM
Posts: 3,
Visits: 18
|
|
Hi all,
I am getting the same errror. My scenario is i have a field called source_system_code in a table of char '1' and not null. I am trying to insert a value 'V' into that. It is giving be error code 2621 saying bad character format in the field. Kindly help in this.
Thanks,
Vanathi
|
|
|
|