vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I don't know if this a bug in MySQL (5), a bug in MyODBC, or if I just misunderstand parameterization of queries, but insight would be appreciated! If I make a parameterized query such as "Select user from usertable where id=@User LIMIT @Number;" ....it hurls on the @Number. If I replace it with a number in the query instead of paramterizing it, like this: "Select user from usertable where id=@User LIMIT 10;" ....then it works just fine. Is this some known limitation or bug, or should I not expect to be able to make the value of the LIMIT clause a parameter? Thanks! Dave |
| ||||
| On Sat, 08 Mar 2008 21:02:04 +0100, <wikitalk@gmail.com> wrote: > I don't know if this a bug in MySQL (5), a bug in MyODBC, or if I just > misunderstand parameterization of queries, but insight would be > appreciated! > > If I make a parameterized query such as > > "Select user from usertable where id=@User LIMIT @Number;" > > ...it hurls on the @Number. If I replace it with a number in the > query instead of paramterizing it, like this: > > "Select user from usertable where id=@User LIMIT 10;" > > ...then it works just fine. Is this some known limitation or bug, or > should I not expect to be able to make the value of the LIMIT clause a > parameter? http://dev.mysql.com/doc/refman/5.0/...variables.html "User variables may be used in contexts where expressions are allowed. This does not currently include contexts that explicitly require a literal value, such as in the LIMIT clause of a SELECT statement, or the IGNORE N LINES clause of a LOAD DATA statement." -- Rik Wasmus |