Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Unanswered: Inserting data from SQL pass thru to Access Table

    Hi

    I have a set of PassThru Queries into Oracle Dbase which work fine as is.

    I want to append the output of these queries into a table in the Access Db the pass thrus run from

    I'm getting an error 'ORA00926 - missing VALUES keyword' with the code I'm using - have you any suggestions please

    Syntax:
    INSERT INTO WEEKDATA ( REG_KEY, REG_TYPE, DAY, REGCRS, STUCRS, RPROG, PERSON, WK, MARK, DUR, WDATE, STIME, ETIME ) IN 'C:\register\2008-9\Attendance\week_parse.mdb',
    SELECT
    RM.REG_KEY,
    RM.REG_TYPE,
    RM.DAY,
    RM.SBJ_CODE_P AS REGCRS,
    SR.SBJ_CODE_P AS STUCRS,
    SR.REG_PRG_TYPE AS RPROG,
    SR.PERSON_CODE AS PERSON,
    1 AS WK,
    SR.ATT_TYPE_01 AS MARK,
    SR.DURATION_01 AS DUR,
    TO_CHAR(R1.DATE_01,'DD/MM/YYYY') AS WDATE,
    TO_CHAR(R1.START_01,'HH24:MI') AS STIME,
    TO_CHAR(R1.END_01,'HH24:MI') AS ETIME

    FROM
    INSTITUTION_DETAILS ID,
    REGISTERS_MAIN RM,
    STUDENT_REGISTER SR,
    REGISTERS_1 R1

    WHERE ID.PARAMETER = 'DEFAULT_REG_SESSION' AND ID.PARAMETER_VALUE = RM.SESSION_CODE AND RM.REG_KEY = SR.REG_KEY AND SR.REG_KEY = R1.REG_KEY;


    thanks

  2. #2
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    Well you lost me with that code. What I do with PassThru queries is to have a separate append query in Access that uses the PassThru. When you create the append query just select the query you want to base the results to be appended.

    Does that make sense? As long as the PassThru works wrapping that query into an Access Append query should work as well.

    C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •