开发者

Oracle & SQL Server Dataset comparison

I am trying to do a C# dataset caparison between two datasets from two different DB's. Dataset one is from Oracle and Dataset two is from SQL Server and I'm comparing these datasets after an ETL jobs runs to move data from Oracle to SQL Server to validate the results. Problem I'm having is that the data in SQL Server matches but the Dates are in a different format from source to destination and also decimal point rounding.

Has anyone got a开发者_开发问答 good way to circumvent this problem. I was thinking about changing my queries from the source and destination tables that fill the Dataset to format the dates etc... so the comparison would be easier but I wanted to see was there any other way?


For the date formats set the NLS_DATE_FORMAT environment variable to the desired format. This assumes that you catch the data in a string. Oracle will format the date to the format you specified. For the decimal point rounding I don't get it. Those numbers should be the same. In case you get a decimal point and want a comma, use NLS_MUMERIC_CHARACTERS 'DG' to choose which character to use a Decimal point or Group separator.

For example '.,' selects a '.' for decimal point and a comma for group separator.

The environment variables can be set from the clients OS and also from within the Oracle session. To do this, issue alter session set nls_date_format = 'YYYYMMDDHH24MISS'; or whatever format suits you best.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜