SQL Server Performance

Oracle linked server function return unexpected values

Discussion in 'SQL Server 2005 General Developer Questions' started by hernan93, Nov 10, 2009.

  1. hernan93 Member

    Hello everybody:

    I have a linked server from SQL Server 2000 and SQL Server 2005 to Oracle 10g. Both installations are Win2K3 R2 x64, SQL Server 2000 SP4, SQL Server 2005 SP2 and have the Oracle client x64 installed correctly, in fact, I have tested the connection successfully and I have run a command like
    select * from openquery(ORACLESERVER,'SELECT to_char(sysdate,''DD-MON-YY'') FROM dual').

    However when I try to use the following sentence
    select * from openquery(BAN2,'SELECT PK_SERVICES.TS(to_char(sysdate,''DD-MON-YY''),''USD'',''COP'') FROM dual')
    I get an unexpected value in SQL Server 2005 (I get -2), while in SQL Server 2000 I get the right value.

    The function PK_SERVICES.TS receives three character parameters. I have tried changing the sentence in many ways with no result. All tests show me that it seems to be a parameter problem... I mean oracle is not understanding what SQL Server 2005 is sending to.

    Please help, does anyone have any idea about what could be happening??

    Thanks in advance.
    Hernan.
  2. moh_hassan20 New Member

    what datatype you use ?, if nvarchar try varchar.
    what oledb provider you use for oracle?
    Are collation of the two database sql 2000/2005 the same?

Share This Page