View Single Post
Old Aug 8th, 2007, 6:31 AM   #5
rubia126
Newbie
 
Join Date: Aug 2007
Posts: 1
Rep Power: 0 rubia126 is on a distinguished road
Database administration

Quote:
Originally Posted by King View Post
I am trying to write a SQL stored procedure that will search a certain field in a table. This is what I have so far:
CREATE PROCEDURE pSearchRecords
(
 @Category varchar(50),
 @Search varchar(50)
)
AS
SELECT * FROM tAddressBook
WHERE @Category = @Search
@Category is the field I want to search, and @search is the text I want to search for in that field. The problem is when I go "@Category = @Search", it checks the actual value of the variable @Category instead of using that value as the field I want to search. Does anyone know how I can do this properly? Thanks.



Hey thr

well i dont know much about your problem but i have a hunch that your having some sort of database issues... am a CS student and was facing same sort of issues few days back.. my frend use to visit www.oracleplace.com for soving his programming and database issues on his advice i try it on too and guess waht it helps me out... hope this will help you too.

Good Luck
BIA

Last edited by rubia126; Aug 8th, 2007 at 6:33 AM. Reason: spelling mistake
rubia126 is offline   Reply With Quote