Using character strings in where clause when linking to Oracle

  • Greetings, I am running sql server 2000 and attempting to link to an oracle 10g database running on Linux and use character strings in the where clause;

    select

    a.mothraid as PersonID,

    null as UNIQUE_ID,

    a.loginid as LoginID,

    a.ucd_pi_source as PiCategoryCode,

    a.firstname as fname,

    a.lastname as lname,

    a.middleinitial as mi,

    a.suffix as Suffix,

    a.deptcode as DeptCode,

    a.email_address as Email,

    CASE a.undergrad WHEN '1' THEN '0' ELSE '1' END as inv,

    a.ikrb as Login

    from OPENQUERY(MOTHRA,

     'select *

      from MOTHRA.INFOED_PEOPLE where mothraid not in ('00350077', '00072066')') a

     
    It appears that the quotes surrounding the character strings are being interpreted as a quote at the end of the statement. mothraid is a varchar variable. I can't figure out how to do this, can anyone help?
    Thanks.
  • from OPENQUERY(MOTHRA,

     'select *

      from MOTHRA.INFOED_PEOPLE where mothraid not in (''00350077'', ''00072066'')') a

    _____________
    Code for TallyGenerator

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply