on 05-07-2009 9:43 AM
Hello Experts,
I am receiving a "decimal" data in "string" format from the input proxy . I tried to insert the data into the table with column defined as decimal(15, 2). Its showing an error at JDBC adapter saying that "Error converting datatype nVarchar to decimal".
Experts please help me out in resolving this.
Scenario is Proxy to JDBC using Stored Procedure.
Thanks ,
Srivatsan
in ur target structure fro this field change the data type to xsd:decimal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Try this in mapping.
SourceFormatNumber(NumberFormat: #.00 decimal separator: .)target field.
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.
"decimal" data in "string" format from the input proxy
If i get it right the source will be sending you data in a field which has type as xsd:string......and then you need to send this data to the DB which can accept only decimal with length 15 and 2 digits after decimal...
So in XI you will need to implement String_to_Decimal logic in your mapping program...also you need to take care that the target node that you are using in XI has type xsd:decimal....
this can be achieved by using a UDF (i suppose there is one available on SDN)....just search for it....
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srivatsan,
What does the "type" attribute for this field state in the XML SQL data type?
Is it "DECIMAL"?
Best regards,
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
make sure the source data has the right format for the decimal.
Also note that you should not have any comma etc in the source data
eg.
the DB will accept values like 1000.50 but not 1,000.50
confirm on the data that you are sending and check if it is as expected by the DB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are using stored procedure then receive this string value in a varchar variable in JDBC side.
Then in the stored procedure you can type cast this to float or decimal and then update the table.
If from XI you directly try to update a decimal field in DB through a string field in XI it will give you a type mismatch error.
Regards,
Siddhesh S.Tawate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.