6 Replies Latest reply: Dec 5, 2014 5:58 AM by anbu cheliyan RSS

    SQL parse error, problem with Exist()

      Hi, in script i load two tables,

       

      ACTIVITY_DEFS:

      LOAD DESCRIPTIVENAME as DESCRIPTIVENAME_ACT_DEFS,

          ID as ID_ACT_DEFS,

          INSTRUCTIVENAME as INSTRUCTIVENAME_ACT_DEFS;

      SQL SELECT DESCRIPTIVENAME,

          ID,

          INSTRUCTIVENAME

      FROM "VT_DM_DATABASE"."BI_TWFLACTIVITYDEFS";

       

       

      ACTIVITY_INSTANCES:

      LOAD ACTIVITY_ID as ACTIVITY_ID_ACT_INST,

          ID as ID_ACT_INST,

          "IPROCESS_ID" as ID_PROCESS_INSTANCES,

          "LASTASSIGNEDBY_ID" as LASTASSIGNEDBY_ID_ACT_INST,

          "LASTWORKER_ID" as LASTWORKER_ID_ACT_INST,

          STARTDATE as NA_STAN_DATA_ACT_INST,

      SQL SELECT ACTIVITY_ID,

          ID,

          "IPROCESS_ID",

          "LASTASSIGNEDBY_ID",

          "LASTWORKER_ID",

          STARTDATE

      FROM "VT_DM_DATABASE"."BI_TWFLACTIVITYINSTANCES" WHERE EXISTS (ID_ACT_DEFS, ACTIVITY_ID);

       

       

      And after adding this WHERE EXISTS ... statement i got the following error :

      SQL##f - SqlState: 37000, ErrorCode: 4294963590, ErrorMsg: [Teradata][ODBC Teradata Driver][Teradata Database] Syntax error: parse error.

      SQL SELECT ACTIVITY_ID,

          ID,

          "IPROCESS_ID",

          "LASTASSIGNEDBY_ID",

          "LASTWORKER_ID",

          STARTDATE

      FROM "VT_DM_DATABASE"."BI_TWFLACTIVITYINSTANCES" WHERE EXISTS (ID_ACTIVITY_DEFS, ACTIVITY_ID)

       

      I tried almost everything to solve this, what am i missing ?