labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_ClientSimpleSearch
Parameters
Name
Type
Mode
search
varchar(75)
IN
page
int
IN
pagesize
int
IN
userid
int
IN
Definition
BEGIN PREPARE STMT FROM "Select ClientID, Name, Address1, Address2, City, State, Zip, Phone, Fax, Comment, Last_User, Country from clients Where ( ClientID like CONCAT('%', ?, '%') or Name like CONCAT('%', ?, '%') or Address1 like CONCAT('%', ?, '%') or Address2 like CONCAT('%',?, '%') or City like CONCAT('%', ?, '%') or State like CONCAT('%', ?, '%') or Zip like CONCAT('%', ?, '%') or Phone like CONCAT('%', ?, '%') or Fax like CONCAT('%', ?, '%') or Comment like CONCAT('%', ?, '%') or Last_User like CONCAT('%', ?, '%') or Country like CONCAT('%', ?, '%') ) and clientid in (Select clientid From UserSec Where UserID=?) order by Name ASC LIMIT ?,?"; SET @LIMIT = (page * pagesize) - pagesize; SET @size = pagesize; SET @s = search; SET @U = userid; EXECUTE STMT USING @s,@s,@s,@s,@s,@s,@s,@s,@s,@s,@s,@s,@U,@LIMIT,@size; END