August 1, 2003 at 10:24 am
I know I typed this wrong during testing but I didn't get an error.
I was consolidating a stack of IF .. OR IF .. into a IN clause
IN ('4897','4898','4899','4896','4424','4425','4426','4434')
Works Just fine
IN ('4897' '4898' '4899' '4896' '4424' '4425' '4426' '4434')
Produces a Syntax error (there is a space between each entry)
IN ('4897''4898''4899''4896''4424''4425''4426''4434')
Runs just fine, but only uses the first ('4897') entry. No space between each entry.
Just something to watch out for.
KlK, MCSE
KlK
August 2, 2003 at 2:02 am
Kevin,
The last example won't throw an error because it's a valid SQL string. The lack of intervening spaces means that the doubled quotes are interpreted as single quotes.
If you run:
select '4897''4898''4899''4896''4424''4425''4426''4434'
You get:
4897'4898'4899'4896'4424'4425'4426'4434
Cheers,
- Mark
Cheers,
- Mark
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy