Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Location
    Dublin, Ireland
    Posts
    16

    Unanswered: Problem with a select in a stored procedure

    Does anybody know what is wrong with this code from a stored procedure:
    DECLARE tables_cursor CURSOR FOR
    SELECT tf_change_out_id, destination, re_table, date_in
    FROM tf_change_out_table
    WHERE date_out = NULL
    ORDER BY tf_change_out_id

    Here is the error I'm getting:
    Error 107: The column prefix 'tf_change_out_table' does not match with a table name or alias name used in the query.

  2. #2
    Join Date
    Feb 2004
    Posts
    492
    Perhaps there's something before the cursor declaration that results in the error below. If you'd select the cursor-declaration, and parse it, is there an error message?

  3. #3
    Join Date
    Oct 2004
    Location
    Dublin, Ireland
    Posts
    16
    Silly me! The error was further down the code. Why can't they give line numbers with all the errors?

  4. #4
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    That woud make it too easy, and then everyone would think they could write SQL


    Besides ... if it was hard to write, it should be hard to read

Posting Permissions

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