Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.WPKTrackChange ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create procedure "pears"."WPKTrackChange"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "sTrackerType" char(1),in "sTrackerID" char(50) ) begin if "strackertype" is null or "strackerid" is null then return end if; if "left"("strackerid",1) = '#' then set "strackerid" = "right"("strackerid","length"("strackerid")-1) end if; if exists(select "wpkchangetrackerid" from "wpkchangetracker" where "wpkchangetrackertype" = "strackertype" and "wpkchangetrackerid" = "strackerid") then update "wpkchangetracker" set "clickcount" = (if "clickcount" between-2 and-1 then 1 else "clickcount"+1 endif) where "wpkchangetrackertype" = "strackertype" and "wpkchangetrackerid" = "strackerid" else insert into "wpkchangetracker"( "wpkchangetrackertype","wpkchangetrackerid","clickcount" ) values( "strackertype","strackerid",1 ) end if end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."WPKTrackChange" IS {create procedure WPKTrackChange /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in sTrackerType char(1),in sTrackerID char(50)) begin if strackertype is null or strackerid is null then return end if; if left(strackerid,1)='#' then set strackerid=right(strackerid,length(strackerid)-1) end if; if exists(select wpkchangetrackerid from wpkchangetracker where wpkchangetrackertype = strackertype and wpkchangetrackerid = strackerid) then update wpkchangetracker set clickcount = (if clickcount between -2 and -1 then 1 else clickcount+1 endif) where wpkchangetrackertype = strackertype and wpkchangetrackerid = strackerid else insert into wpkchangetracker(wpkchangetrackertype,wpkchangetrackerid,clickcount) values (strackertype,strackerid,1) end if end } </code> database/procedures/pears_wpktrackchange.txt Last modified: 2026/08/07 19:24by 127.0.0.1