in reply to Preventing malicious T-SQL injection attacks
This will produce something that looks like$Command = "EXEC $SPROC " . join ', ', ('?') x $elements_in_array;
(I have no idea if this is the proper syntax for calling stored procedures in T-SQL — perhaps it needs parens?)EXEC FOO ?, ?, ?
(The undef comes in place of the \%attr in the docs.)$dbh->do($Command, undef, @CHOICE[1 .. $elements_in_array])
That ought to remove all possible problems related to dangerous values in ther parameters, as they're all treated as content of strings.
And yes, you should check if $PROC looks right, like a proper procedure name, for example with a regex.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |