MySQL Forums
Forum List  »  Stored Procedures

Re: SELECTS not working in SP's?
Posted by: Mike Kruckenberg
Date: June 24, 2005 01:21PM

The problem may be the conflict between your IN parameter "name" and the WHERE clause of your query, "name = parent." Since you are defining the name as a local variable in the SP, when you use "name = parent" it is using parameters for both of them, thus if you call the SP:

CALL add_attribute('john','my dad','charlie');

Your cursor definition will be:

SELECT left_position, right_position FROM attribute WHERE 'John' = 'Charlie';

This will always return no records;

If you have a "name" column in your table, you might try changing the IN parameter to a different variable to keep the SP clear on what you're trying to accomplish.

Options: ReplyQuote


Subject
Views
Written By
Posted
2036
June 24, 2005 10:25AM
Re: SELECTS not working in SP's?
2172
June 24, 2005 01:21PM
1952
June 24, 2005 01:28PM
2040
June 24, 2005 01:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.