Click here to Skip to main content
15,893,722 members
Home / Discussions / Database
   

Database

 
AnswerRe: retrieving column's data Pin
RyanEK24-Oct-10 11:47
RyanEK24-Oct-10 11:47 
QuestionSQL Server 2008 - Number Manipulation Pin
ac01121-Oct-10 6:59
ac01121-Oct-10 6:59 
AnswerRe: SQL Server 2008 - Number Manipulation Pin
Eddy Vluggen21-Oct-10 10:05
professionalEddy Vluggen21-Oct-10 10:05 
AnswerRe: SQL Server 2008 - Number Manipulation Pin
RyanEK21-Oct-10 14:39
RyanEK21-Oct-10 14:39 
GeneralRe: SQL Server 2008 - Number Manipulation Pin
ac01121-Oct-10 23:07
ac01121-Oct-10 23:07 
QuestionUpdate query does not affects matched Pin
Abdul-Rhman Alsri21-Oct-10 5:28
Abdul-Rhman Alsri21-Oct-10 5:28 
AnswerRe: Update query does not affects matched Pin
Eddy Vluggen21-Oct-10 10:02
professionalEddy Vluggen21-Oct-10 10:02 
QuestionStored Procedure Pin
Nath20-Oct-10 22:19
Nath20-Oct-10 22:19 
i have one table(EMPLOYEE), in that columns are(Emp_Id,First_Name,Last_Name,Gender,Mobile_No,Email_id,Blood_Group);
in my front end page having 4 text boxies.that is emp_id,emp_name,mobile_no,blood_group.(here search buttion),
whenever we give id( or) name (or )mbno( or) bloodgroup(or) any combinations then result come with (Emp_Id,First_Name,Last_Name,Gender,Mobile_No,Email_id,Blood_Group)display.
i try some code but result is not coming.code is following
----------------------------
DELIMITER $$

CREATE PROCEDURE sp_srch(in empid varchar(10), empname varchar(45),mobileno varchar(15),bloodgroup varchar(5))
BEGIN
declare str varchar(255);
declare str1 varchar(20);
declare str2 varchar(20);

set str ="select Emp_Id,First_Name,Last_Name,Gender,Mobile_No,Email_id,Blood_Group from Employee where ";
if(empid!= '') then
set str= Concat(str ,"Emp_ID like '%", empid ,"%'and ");
end if;
if(empname!='') then
set str= Concat(str , "First_Name like '%" , empname ,"%'and ");
end if;
if(mobileno!='') then
set str= Concat(str , "Mobile_No like '%" , mobileno ,"%'and ");
end if;
if(bloodgroup!='') then
set str= Concat(str ,"Blood_Group like '" , bloodgroup ,"%' ");
end if;

set str1= (SUBSTR(str,-6));
set str2 = (SUBSTR(str,-4));


if(str1='where') then
set str= replace(str,'where','');
end if;
if(str2='and') then
set str= replace(str,' and','');
end if;

select str;


END $$

DELIMITER ;
AnswerRe: Stored Procedure Pin
J4amieC20-Oct-10 23:38
J4amieC20-Oct-10 23:38 
GeneralRe: Stored Procedure Pin
Mycroft Holmes21-Oct-10 13:04
professionalMycroft Holmes21-Oct-10 13:04 
GeneralRe: Stored Procedure Pin
J4amieC21-Oct-10 21:48
J4amieC21-Oct-10 21:48 
GeneralRe: Stored Procedure Pin
Mycroft Holmes22-Oct-10 0:52
professionalMycroft Holmes22-Oct-10 0:52 
QuestionReturn name and identity for all tables Pin
yippiecoder20-Oct-10 10:55
yippiecoder20-Oct-10 10:55 
AnswerRe: Return name and identity for all tables Pin
Blue_Boy20-Oct-10 21:12
Blue_Boy20-Oct-10 21:12 
GeneralRe: Return name and identity for all tables Pin
David Skelly20-Oct-10 22:40
David Skelly20-Oct-10 22:40 
QuestionI want your help Pin
Lamis Radman19-Oct-10 9:31
Lamis Radman19-Oct-10 9:31 
AnswerRe: I want your help Pin
Pete O'Hanlon20-Oct-10 0:02
mvePete O'Hanlon20-Oct-10 0:02 
QuestionXml datatype vs cdc Pin
Ebube19-Oct-10 6:47
Ebube19-Oct-10 6:47 
AnswerRe: Xml datatype vs cdc Pin
Mycroft Holmes19-Oct-10 12:22
professionalMycroft Holmes19-Oct-10 12:22 
GeneralRe: Xml datatype vs cdc Pin
Ebube21-Oct-10 5:37
Ebube21-Oct-10 5:37 
Questionhow to use % symbol in Like statement. Pin
shiva.kore18-Oct-10 21:13
shiva.kore18-Oct-10 21:13 
AnswerRe: how to use % symbol in Like statement. PinPopular
thatraja18-Oct-10 21:21
professionalthatraja18-Oct-10 21:21 
QuestionMessage Removed Pin
18-Oct-10 8:03
eddieangel18-Oct-10 8:03 
AnswerRe: Normalization / Referential Integrity Pin
Eddy Vluggen18-Oct-10 8:21
professionalEddy Vluggen18-Oct-10 8:21 
AnswerRe: Normalization / Referential Integrity Pin
Chris Meech18-Oct-10 8:43
Chris Meech18-Oct-10 8:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.