Wednesday, March 21, 2012

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.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?|||Silly me! The error was further down the code. Why can't they give line numbers with all the errors?|||That woud make it too easy, and then everyone would think they could write SQL :D


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

No comments:

Post a Comment