insert into sqltable@sql2000 select add_months(workdate,3) from oracletable
报错数据库sql2000不支持此上下文中的add_months
请问怎样能使用oracle中的函数??
注:链接没问题 select 很正常,去除add_months也能正常插入

解决方案 »

  1.   

    用sqlserver的函数:  Select dateadd(mm,3,workdate)
      

  2.   

    上面回错了,报的是dateadd标识符无效~~~~我有点晕 用了链接 sql语句到底是交给谁解析~~~~~~·是sql还是oracle????
      

  3.   

    这个函数不能被支持的。详细请看oracle问党:http://www.filibeto.org/sun/lib/nonsun/oracle/10.2.0.1.0/B19306_01/gateways.102/b14270/apb.htm#i634323
      

  4.   

    B.2.2 Functions Supported by Microsoft SQL ServerThe gateway translates the following Oracle database server functions in SQL statements to their equivalent Microsoft SQL Server functions:    *      Arithmetic Operators
        *      Comparison Operators
        *      Pattern Matching
        *      Group Functions
        *      String Functions
        *      Other FunctionsB.2.2.1 Arithmetic Operators
    Oracle  Microsoft SQL Server
    +
    +
    -  -
    *
    *
    /
    /B.2.2.2 Comparison Operators
    Oracle  Microsoft SQL Server
    =
    =
    >  >
    <
    <
    >=  >=
    <=
    <=
    <>, !=, ^=  <>
    IS NOT NULL  IS NOT NULL
    IS NULL  IS NULLB.2.2.3 Pattern Matching
    Oracle  Microsoft SQL Server
    LIKE  LIKE
    NOT LIKE  NOT LIKEB.2.2.4 Group Functions
    Oracle  Microsoft SQL Server
    AVG  AVG
    COUNT  COUNT
    MAX  MAX
    MIN  MIN
    SUM  SUMB.2.2.5 String Functions
    Oracle  Microsoft SQL Server
    ||, CONCAT  + (expression1 + expression2)
    ASCII  ASCII
    CHR  CHAR
    INSTR (with two arguments)  CHARINDEX
    LENGTH  DATALENGTH
    LOWER  LOWER
    LTRIM  LTRIM
    RTRIM  RTRIM
    SUBSTR (second argument cannot be a negative number)  SUBSTRING
    UPPER  UPPERB.2.2.6 Other Functions
    Oracle  Microsoft SQL Server
    ABS  ABS
    CEIL  CEILING
    COS  COS
    EXP  EXP
    FLOOR  FLOOR
    LN  LOG
    LOG  LOG10
    MOD  %
    NOT NVL  IS NOT NULL
    NVL  IS NULL
    POWER  POWER
    ROUND  ROUND
    SIN  SIN
    SQRT  SQRT
    TAN  TAN
      

  5.   

    那看来没别的办法了~~~只能插入到临时表里再insert了
    :(