on 05-07-2009 1:44 PM
Hi Friends,
I am struck in a scenario where the data from proxy should update in the MS SQL Database.
We have a field in the source which is given as String type and the same in Target side also.
But in the Database, it is mentioned as decimal (18, 3).
With the above conditions when i try to insert the data in the database, it is throwing an error. The error reads in Communication channel monitoring as " Error converting data type nvarchar to decimal ".
The requirement is that nothing should be modified in the database.
Can anyone please help us on this issue.
Thanks in advance ....
Regards,
Sherin Jose
Thanks for the replies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Just use this in mapping.
source field-formatNumber(Number format:#.000 Decimal separator: .)targetfield.
Regards,
Prakasu.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If that field contains any character value or any symbol it will through the error.there is no problem if decimal field is missing.lets consider if value is 100 target field will fill 100.000.Kindly check your input and let me know.
Regards,
Prakasu.M
Edited by: prakasu on May 7, 2009 7:05 PM
Hi,
Thanks for the reply.
That is not the scenario actually. The input data actually comes in decimal only, it cannot come as a integer.
for example it comes as 35.002.
Here the thing is that i have given String in source datatype and String in target datatype. But, in database it is given as Decimal (16, 3). Is the error formed because of this mismatch. If so whats the solution.
Thanks in advance.
HI jose,
If the Decimal (16, 3) format (indicates before decimal max 16 digites after decimal max 3 digit numaric) will allow the same format value.it wont consider with the data type. If you are using the formatNumber(#.000) you are changing the format to required format. So if you are chaning the format to xsd:decimal also it may be a problem.If the input value contains 19.1234 it will allow.But data base not accept this value.Check your input data first. It should contain some symbol or character like -12.1234 or 12a3.123.
Regards,
Prakasu.M
I have figured out the solution for this.
I tried by giving decimal in both source and target. And it works now.
And also i gave string in source and target as decimal and i gave a default value of 0.00 in mapping. This also worked.
In my scenario, i faced the problem because when no data is passed for a decimal field which is given as string in both the sides and i have mapped the source and target with " Map with default ". Actually a blank space has to updated in the database if the type in database is varchar, since its decimal in database .. the blank space is not able to get updated there. but, this has been solved where im using 0.00 as default value when no data for decimal field comes to the database.
While creating Data Type, we have a option called "Default". What does this exactly mean. If we give 0.00 as default value for the decimal field and have it as string itself in source and target. Will this condition work.
>> If we give 0.00 as default value for the decimal field and have it as string itself in source and target.
Will this condition work
This wont work for you,the value specified in "Default" is for use of Proxy,this value is discarded at the time of message mapping,so the best option you have is to use the "mapWithDefault" standard function in message mapping itself and specify value 0.00 there
Thanx
Aamir
Change the same in XI...
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.