Hi Andy,
Thanks for your help. You are correct. It's the scoping which comes into play if there is ambiguity.
If the parameter name is accidently same as the column name, then it will generate unexcepted result.
So the lesson is
"Never use the parameter name that is same as the column name."
Once again thanks for solving this.
With Regards,
Jake
Quote:
Originally posted by ARWinner
Jake,
I believe that it is a scope issue. The "dept" inside the FOR loop is not the same ase the "dept" parameter. The columns defined in the select of the FOR loop are only valid within the FOR loop.
HTH
Andy
|