labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_ProductkeySimpleSearch
Parameters
Name
Type
Mode
search
varchar(75)
IN
page
int
IN
pagesize
int
IN
userid
int
IN
Definition
BEGIN PREPARE STMT FROM "Select a.ID, b.Name, a.ProductName, a.Serial, a.License, a.ExpireDate, a.Notes, a.ClientID from ProductKeys a, Clients b where a.clientid = b.clientid and ( a.ID like concat('%',?,'%') or b.Name like concat('%',?,'%') or a.ProductName like concat('%',?,'%') or a.Serial like concat('%',?,'%') or a.License like concat('%',?,'%') or a.Notes like concat('%',?,'%') ) and a.clientid in (Select clientid From UserSec Where UserID=?) order by a.ProductName ASC, b.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,@U,@LIMIT,@size; END