Suppose I have a stored procedure like this:
I know I can call the procedure viaCREATE PROCEDURE dbo.Foo ( @Required Int, @Optional Int = 0 ) AS ...
ormy $sth2 = $db->prepare('EXEC dbo.Foo ?, ?'); $sth2->execute(1,2);
But is there any way to specify I want to use the default value even with the first prepared statement? So that I don't have to prepare the same procedure twice...my $sth1 = $db->prepare('EXEC dbo.Foo ?'); $sth1->execute(1); # use the default for the second param
I can't call $sth2->execute(1) since that triggers an error (execute failed: called with 1 bind variables when 2 are needed), I can't use undef since that would translate to NULL, ...
Thanks, Jenda
| XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented. |
In reply to DBI->MS SQL, optional parameters to stored procedures by Jenda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |