Announcement

Collapse
No announcement yet.

Übersetzung aus Access "SQL" in Oracle SQL

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Übersetzung aus Access "SQL" in Oracle SQL

    Hallo zusammen,

    nachdem ich eine Abfrage in Access in SQL für Oracle übersetzen möchte stoße ich auf folgende Schwierigkeit. In Access wird mir die IIF-funktion angezeigt. Diese funktioniert allerdings trotz anpassung nicht in Oracle.

    Was ist über die üblichen anpassungen hinweg zu machen ?

    Gruß
    Theo B.

    Angepasster Code:
    Code:
    .
    .
    IIF(LS_NRWPROD01.TASK.Name Like 'PB', LS_NRWPROD01.WORK_STRUCTURE_DATES.OPX2_START, '') AS PB_SOLL
    FROM
    .
    .
    .

  • #2
    In oracle gibt es das CASE statement.

    Beispiel gibts hier

    für deinen fall angewendet siehts wohl so aus:

    [highlight=sql]
    SELECT
    CASE
    WHEN LS_NRWPROD01.TASK.Name Like 'PB' THEN LS_NRWPROD01.WORK_STRUCTURE_DATES.OPX2_START
    ELSE ''
    END
    FROM ...
    [/highlight]

    Comment


    • #3
      zu spät
      Code:
      n Access, the iif function returns one value if a specified condition evaluates to TRUE, or another value if it evaluates to FALSE.
      
      The syntax for the iif function is:
      
          iif ( condition, value_if_true, value_if_false )
      
      condition is the value that you want to test.
      
      value_if_true is the value that is returned if condition evaluates to TRUE.
      
      value_if_false is the value that is return if condition evaluates to FALSE.
      
      For example:
      
          iif ([Qty] > 10, "large", "small")
      
      would return "large" if the value in the Qty field is greater than 10. Otherwise, it would return "small".
      Also entweder mit:
      Code:
      CASE WHEN condition THEN ret_expr1 ELSE ret_expr2 END
      oder ggf. mit:
      Code:
      DECODE(expr, value1 [, return1, value2, return2....,] default )
      Viel Erfolg!
      Zuletzt editiert von jum; 28.01.2010, 12:31.

      Comment

      Working...
      X