ODBC Sql Server Error

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
anto.vis
Participant
Posts: 1
Joined: Mon Apr 07, 2008 3:46 am

ODBC Sql Server Error

Post by anto.vis »

Hi all,
I have a problem when I try to write into a Sql Server Db (from db2), and the datatype of target column is "money".

the log show this errror: ODBC function "SQLExecute" reported: SQLSTATE = 22018: Native Error Code = 0: Msg = [IBM(DataDirect OEM)][ODBC SQL Server Legacy Driver]Invalid character value for cast specification (CC_OdbcDBStatement::executeInsert, file CC_OdbcDBStatement.cpp, line 731)

I tried also this: change (column_name,",",".") but in this case the job write always 0 (0,00).

My ODBC properties:
Array size: 1
Fail on size mismatch: No
Fail on type mismatch: No
Drop unmatched fields: No
Code page: Default
Fail on row error: Yes

Have you any suggestion?

Thanks and regards.
Antonio
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

SQL Server's "money" (CURRENCY) data type is Decimal(19.4)

The reason for this, so I believe, is that Microsoft had planned to take over all world currencies and replace them with one called the Bill. Each of these would be worth so much that four decimal places are needed for sensible amounts, such as the cost of a cup of coffee (0.0002 Bills).
:lol:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ladies and Gentlemen, Ray Wurlod!
<smattering of applause>

Antonio,

What is your source datatype? Are you doing the CAST (custom insert SQL) or is that happening automatically? I for one would also like to see some of the source values, see what the data looks like that you are trying to put into this MONEY field.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply