labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_LocationSimpleSearch
Parameters
Name
Type
Mode
search
varchar(75)
IN
page
int
IN
pagesize
int
IN
userid
int
IN
Definition
BEGIN PREPARE STMT FROM "Select a.LocationID, b.Name, a.Name, a.Address, a.City, a.State, a.Zip, a.Phone, a.Fax, a.ClientID from Locations a, Clients b where a.clientid = b.clientid and ( a.LocationID like concat('%',?,'%') or b.Name like concat('%',?,'%') or a.Name like concat('%',?,'%') or a.Address like concat('%',?,'%') or a.City like concat('%',?,'%') or a.State like concat('%',?,'%') or a.Zip like concat('%',?,'%') or a.Phone like concat('%',?,'%') or a.Fax like concat('%',?,'%') ) and a.clientid in (Select clientid From UserSec Where UserID=?) order by b.Name ASC, a.Name ASC LIMIT ?,?"; SET @LIMIT = (page * pagesize) - pagesize; SET @s = search; SET @size = pagesize; SET @U = userid; EXECUTE STMT USING @s,@s,@s,@s,@s,@s,@s,@s,@s,@U,@LIMIT,@size; END