passing quoted parameters to sproc

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

I have a p_search procedure that takes many parameters from a screen. If the user types the string O'Lara in the search box, the application passes to the proc 'O''Lara' so the procedure looks like p_search 1,2, ...., 'O''Lara', ... This gives me an error as incorrect syntax near L . Any thoughts, help. Thanks in advance.

-- Anonymous, April 27, 2000

Answers

Rajesh,

My guess is that the call to p_search does not, in fact, look like:

p_search 1,2, ...., 'O''Lara', ...

If you cannot find a problem upon further inspection, try passing the argument into the stored procedure as typed, but in double qoutes. That is, call p_search like so:

p_search 1,2, ...., "O'Lara", ...

Good Luck,

Eric

-- Anonymous, May 01, 2000


Thanks Eric. I was able to find the error. It was not in the parameter but elsewhere in the program.

-- Anonymous, May 04, 2000

Moderation questions? read the FAQ