on-internet
← Community

Repeated arguments in a prepared statement

Stack Overflow ·

consider a query that looks something like this: my $query=<<QUERY; select * from foo1 where col < ? union all select * from foo2 where col < ? QUERY Assume that the actual query really needs unions and can't be efficiently solved another way. The variable in the where clause will always be the same. Is there any way I can structure this so that I only need to pass 1 argument to execute instead of passing the same argument twice?

Comments

Sign in or sign up to comment and upvote.

No comments yet.