Problem with Forceplan

I am trying to use 'set forceplan on' inside a stored procedure.
I only want to set forceplan on if certain conditions are met.
I do this:
If @var = 1 set forceplan on
Forceplan is always being set on even when @var is not 1.
Has anyone seen this?  The procedure is being executed with recompile so it 
should not be using old plan.
0
Mike_S
2/14/2003 3:37:13 PM
📁 sybase.ase.general
📃 8655 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 893 Views


Hi Mike !
How can you verify that "set forceplan on" is used ?? I don't know of any
way to do so. Just because the optimizer actually chooses to join tables in
the from clause in the same order you wrote them down, this doesn't mean
that "set forceplan on" is the reason... ?
Stefan.

<Mike_S> schrieb im Newsbeitrag
news:1CD986A3926348E40055CE5385256CCD.0055CE6085256CCD@webforums...
> I am trying to use 'set forceplan on' inside a stored procedure.
> I only want to set forceplan on if certain conditions are met.
> I do this:
>
> If @var = 1 set forceplan on
>
> Forceplan is always being set on even when @var is not 1.
> Has anyone seen this?  The procedure is being executed with recompile so
it
> should not be using old plan.

0
Stefan
2/14/2003 4:24:03 PM
Reply: