posted 11 years ago
Your code doesn't use table A at all, it just looks at the single record in table B, decides it's in the table, and behaves accordingly. But there's this code:
I'm surprised that even compiles. Since you don't have any braces (the { and } characters), the scope of the "if" is only the line below it and nothing else. And so the "else" doesn't have any matching "if" before it and the compiler should complain about it. My guess is that you wanted to have braces like this:
But even if you did that, the record you read from table B always has a ? at the beginning so you'll always see the "if" block being run and the "else" block never being run.