Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2016
    Posts
    2
    Provided Answers: 1

    Answered: Issue with UPDATE query: Operation must use an updateable query

    Sample table - The primary key field is word. The DBMS is Access.
    Code:
     
    word            length  ID
    a               1       1
    a couple        8       2
    a.m.            4       NULL
    aaa             3       NULL
    aaerially       9       NULL
    aahed           5       NULL
    aahing          6       NULL
    Query
    Code:
    UPDATE word
    SET word.ID =
    (
        SELECT top 1 word.ID +1
        FROM word
        WHERE word.ID IS NOT NULL
        Order By word.ID DESC
    )
    WHERE
    word.word =
    (
        SELECT top 1 word.word
        FROM word
        WHERE word.id is null
        Order BY word.word ASC
    );
    Error: "Operation must use an updateable query"

  2. Best Answer
    Posted by _Phreak_

    "After reading https://msdn.microsoft.com/en-us/library/aa198446.aspx I think the issue relates to the usage of "TOP 1"

    I've just nuked the data and wrote an application to re-import the date from text files."


  3. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    496
    Provided Answers: 24
    Due to the nature of the query or relations, not all queries can update. (usu if a sum query is involved, you cant update)
    you must simplify the query to do so.

  4. #3
    Join Date
    Apr 2016
    Posts
    2
    Provided Answers: 1
    After reading https://msdn.microsoft.com/en-us/library/aa198446.aspx I think the issue relates to the usage of "TOP 1"

    I've just nuked the data and wrote an application to re-import the date from text files.

Posting Permissions

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