[Tutor] MySQLdb INSERT with while or for loop

Decibels decibelshelp@charter.net
Wed Jun 11 15:42:01 2003


Thanks for the site, will be helpful in the future. Right now it seems to want a constant.
Even though they say User Variables. It seems to mean really User Constant Variables.

Get this error
_mysql_exceptions.OperationalError: (1204, 'You may only use constant expressions with SET')

If I:  SET @VALUE:="IBM"
it works fine. If I:

symbol = "IBM"
cursor.execute("""
	SET @VALUE=symbol;
	""")

Get the above error. I must be missing something and will continue looking at the page you sent.
But you would think that this would be possible and used a lot. Guess not.



On Wednesday 11 June 2003 01:57 pm, you wrote:
> Have you looked here? I don't have time to research the answer but saw this
> site which might lead to a solution.
>
> http://www.idera.com/support/documentation/mySQL_SQL_Reference.htm
>
> --vicki