pears.NetCandidateAddEventsMultiDay

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

CREATE PROCEDURE "pears"."NetCandidateAddEventsMultiDay"( IN "pWebUserID" CHAR(20),IN "pvacancyid" CHAR(20),
  IN "p1Date" CHAR(25) DEFAULT NULL,IN "p1Event" CHAR(20) DEFAULT NULL,IN "p1From" CHAR(25) DEFAULT NULL,IN "p1To" CHAR(25) DEFAULT NULL,IN "p1Brk" CHAR(20) DEFAULT NULL,IN "p1Qty" CHAR(20) DEFAULT NULL,IN "p1Note" CHAR(50) DEFAULT NULL,
  IN "p2Date" CHAR(25) DEFAULT NULL,IN "p2Event" CHAR(20) DEFAULT NULL,IN "p2From" CHAR(25) DEFAULT NULL,IN "p2To" CHAR(25) DEFAULT NULL,IN "p2Brk" CHAR(20) DEFAULT NULL,IN "p2Qty" CHAR(20) DEFAULT NULL,IN "p2Note" CHAR(50) DEFAULT NULL,
  IN "p3Date" CHAR(25) DEFAULT NULL,IN "p3Event" CHAR(20) DEFAULT NULL,IN "p3From" CHAR(25) DEFAULT NULL,IN "p3To" CHAR(25) DEFAULT NULL,IN "p3Brk" CHAR(20) DEFAULT NULL,IN "p3Qty" CHAR(20) DEFAULT NULL,IN "p3Note" CHAR(50) DEFAULT NULL,
  IN "p4Date" CHAR(25) DEFAULT NULL,IN "p4Event" CHAR(20) DEFAULT NULL,IN "p4From" CHAR(25) DEFAULT NULL,IN "p4To" CHAR(25) DEFAULT NULL,IN "p4Brk" CHAR(20) DEFAULT NULL,IN "p4Qty" CHAR(20) DEFAULT NULL,IN "p4Note" CHAR(50) DEFAULT NULL,
  IN "p5Date" CHAR(25) DEFAULT NULL,IN "p5Event" CHAR(20) DEFAULT NULL,IN "p5From" CHAR(25) DEFAULT NULL,IN "p5To" CHAR(25) DEFAULT NULL,IN "p5Brk" CHAR(20) DEFAULT NULL,IN "p5Qty" CHAR(20) DEFAULT NULL,IN "p5Note" CHAR(50) DEFAULT NULL,
  IN "p6Date" CHAR(25) DEFAULT NULL,IN "p6Event" CHAR(20) DEFAULT NULL,IN "p6From" CHAR(25) DEFAULT NULL,IN "p6To" CHAR(25) DEFAULT NULL,IN "p6Brk" CHAR(20) DEFAULT NULL,IN "p6Qty" CHAR(20) DEFAULT NULL,IN "p6Note" CHAR(50) DEFAULT NULL,
  IN "p7Date" CHAR(25) DEFAULT NULL,IN "p7Event" CHAR(20) DEFAULT NULL,IN "p7From" CHAR(25) DEFAULT NULL,IN "p7To" CHAR(25) DEFAULT NULL,IN "p7Brk" CHAR(20) DEFAULT NULL,IN "p7Qty" CHAR(20) DEFAULT NULL,IN "p7Note" CHAR(50) DEFAULT NULL,
  IN "p8Date" CHAR(25) DEFAULT NULL,IN "p8Event" CHAR(20) DEFAULT NULL,IN "p8From" CHAR(25) DEFAULT NULL,IN "p8To" CHAR(25) DEFAULT NULL,IN "p8Brk" CHAR(20) DEFAULT NULL,IN "p8Qty" CHAR(20) DEFAULT NULL,IN "p8Note" CHAR(50) DEFAULT NULL,
  IN "p9Date" CHAR(25) DEFAULT NULL,IN "p9Event" CHAR(20) DEFAULT NULL,IN "p9From" CHAR(25) DEFAULT NULL,IN "p9To" CHAR(25) DEFAULT NULL,IN "p9Brk" CHAR(20) DEFAULT NULL,IN "p9Qty" CHAR(20) DEFAULT NULL,IN "p9Note" CHAR(50) DEFAULT NULL,
  IN "p10Date" CHAR(25) DEFAULT NULL,IN "p10Event" CHAR(20) DEFAULT NULL,IN "p10From" CHAR(25) DEFAULT NULL,IN "p10To" CHAR(25) DEFAULT NULL,IN "p10Brk" CHAR(20) DEFAULT NULL,IN "p10Qty" CHAR(20) DEFAULT NULL,IN "p10Note" CHAR(50) DEFAULT NULL ) 
RESULT( "pResult" CHAR(250) ) 
BEGIN
  DECLARE "swebusername" CHAR(50);
  DECLARE "CanAuthorise" SMALLINT;
  DECLARE "thelog" long VARCHAR;
  DECLARE LOCAL TEMPORARY TABLE "IDs"(
    "ID" CHAR(20) NULL,
    ) NOT transactional;
  INSERT INTO "IDs"( "ID" ) 
    SELECT DISTINCT "e"."companyid" FROM "iqxnetuserlink" AS "l" KEY JOIN "employment" AS "e" WHERE "l"."iqxnetuserid" = "pWebUserID";
  IF NOT "pvacancyid" = any(SELECT "v"."vacancyid" FROM "vacancy" AS "v" KEY JOIN "employment" AS "e" JOIN "IDs" ON "e"."companyid" = "IDs"."ID") THEN
    SELECT '99:~Permission denied';
    RETURN
  END IF;
  IF "IQXNetHasPermission"("pWebUserID",'ORDERJOBS') = 0 THEN
    SELECT '99:~Permission denied';
    RETURN
  END IF;
  SET "swebusername" = (SELECT "name" FROM "iqxnetuser" WHERE "iqxnetuserid" = "pwebuserid");
  SET "CanAuthorise" = "IQXNetHasPermission"("pWebUserID",'AUTHORISEJOBS');
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p1date"),"pshifttemplateid" = "p1","ptimefrom" = "p1from","ptimeto" = "p1to","pbreak" = "p1brk","pnote" = "p1note","pqty" = "p1qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p2date"),"pshifttemplateid" = "p2","ptimefrom" = "p2from","ptimeto" = "p2to","pbreak" = "p2brk","pnote" = "p2note","pqty" = "p2qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p3date"),"pshifttemplateid" = "p3","ptimefrom" = "p3from","ptimeto" = "p3to","pbreak" = "p3brk","pnote" = "p3note","pqty" = "p3qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p4date"),"pshifttemplateid" = "p4","ptimefrom" = "p4from","ptimeto" = "p4to","pbreak" = "p4brk","pnote" = "p4note","pqty" = "p4qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p5date"),"pshifttemplateid" = "p5","ptimefrom" = "p5from","ptimeto" = "p5to","pbreak" = "p5brk","pnote" = "p5note","pqty" = "p5qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p6date"),"pshifttemplateid" = "p6","ptimefrom" = "p6from","ptimeto" = "p6to","pbreak" = "p6brk","pnote" = "p6note","pqty" = "p6qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p7date"),"pshifttemplateid" = "p7","ptimefrom" = "p7from","ptimeto" = "p7to","pbreak" = "p7brk","pnote" = "p7note","pqty" = "p7qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p8date"),"pshifttemplateid" = "p8","ptimefrom" = "p8from","ptimeto" = "p8to","pbreak" = "p8brk","pnote" = "p8note","pqty" = "p8qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p9date"),"pshifttemplateid" = "p9","ptimefrom" = "p9from","ptimeto" = "p9to","pbreak" = "p9brk","pnote" = "p9note","pqty" = "p9qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p10date"),"pshifttemplateid" = "p10","ptimefrom" = "p10from","ptimeto" = "p10to","pbreak" = "p10brk","pnote" = "p10note","pqty" = "p10qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  IF "CanAuthorise" = 1 THEN
    CALL "IQXNetPopup"("pWebUserID",NULL,NULL,"pvacancyid",NULL,NULL,'ADDSHIFTS','New shift requirement(s) added',"thelog")
  END IF;
  SELECT '0:~Success'
END
GO
 
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetCandidateAddEventsMultiDay" IS 
{CREATE PROCEDURE pears."NetCandidateAddEventsMultiDay"( IN "pWebUserID" CHAR(20),IN "pvacancyid" CHAR(20),
  IN "p1Date" CHAR(25) DEFAULT NULL,IN "p1Event" CHAR(20) DEFAULT NULL,IN "p1From" CHAR(25) DEFAULT NULL,IN "p1To" CHAR(25) DEFAULT NULL,IN "p1Brk" CHAR(20) DEFAULT NULL,IN "p1Qty" CHAR(20) DEFAULT NULL,IN "p1Note" CHAR(50) DEFAULT NULL,
  IN "p2Date" CHAR(25) DEFAULT NULL,IN "p2Event" CHAR(20) DEFAULT NULL,IN "p2From" CHAR(25) DEFAULT NULL,IN "p2To" CHAR(25) DEFAULT NULL,IN "p2Brk" CHAR(20) DEFAULT NULL,IN "p2Qty" CHAR(20) DEFAULT NULL,IN "p2Note" CHAR(50) DEFAULT NULL,
  IN "p3Date" CHAR(25) DEFAULT NULL,IN "p3Event" CHAR(20) DEFAULT NULL,IN "p3From" CHAR(25) DEFAULT NULL,IN "p3To" CHAR(25) DEFAULT NULL,IN "p3Brk" CHAR(20) DEFAULT NULL,IN "p3Qty" CHAR(20) DEFAULT NULL,IN "p3Note" CHAR(50) DEFAULT NULL,
  IN "p4Date" CHAR(25) DEFAULT NULL,IN "p4Event" CHAR(20) DEFAULT NULL,IN "p4From" CHAR(25) DEFAULT NULL,IN "p4To" CHAR(25) DEFAULT NULL,IN "p4Brk" CHAR(20) DEFAULT NULL,IN "p4Qty" CHAR(20) DEFAULT NULL,IN "p4Note" CHAR(50) DEFAULT NULL,
  IN "p5Date" CHAR(25) DEFAULT NULL,IN "p5Event" CHAR(20) DEFAULT NULL,IN "p5From" CHAR(25) DEFAULT NULL,IN "p5To" CHAR(25) DEFAULT NULL,IN "p5Brk" CHAR(20) DEFAULT NULL,IN "p5Qty" CHAR(20) DEFAULT NULL,IN "p5Note" CHAR(50) DEFAULT NULL,
  IN "p6Date" CHAR(25) DEFAULT NULL,IN "p6Event" CHAR(20) DEFAULT NULL,IN "p6From" CHAR(25) DEFAULT NULL,IN "p6To" CHAR(25) DEFAULT NULL,IN "p6Brk" CHAR(20) DEFAULT NULL,IN "p6Qty" CHAR(20) DEFAULT NULL,IN "p6Note" CHAR(50) DEFAULT NULL,
  IN "p7Date" CHAR(25) DEFAULT NULL,IN "p7Event" CHAR(20) DEFAULT NULL,IN "p7From" CHAR(25) DEFAULT NULL,IN "p7To" CHAR(25) DEFAULT NULL,IN "p7Brk" CHAR(20) DEFAULT NULL,IN "p7Qty" CHAR(20) DEFAULT NULL,IN "p7Note" CHAR(50) DEFAULT NULL,
  IN "p8Date" CHAR(25) DEFAULT NULL,IN "p8Event" CHAR(20) DEFAULT NULL,IN "p8From" CHAR(25) DEFAULT NULL,IN "p8To" CHAR(25) DEFAULT NULL,IN "p8Brk" CHAR(20) DEFAULT NULL,IN "p8Qty" CHAR(20) DEFAULT NULL,IN "p8Note" CHAR(50) DEFAULT NULL,
  IN "p9Date" CHAR(25) DEFAULT NULL,IN "p9Event" CHAR(20) DEFAULT NULL,IN "p9From" CHAR(25) DEFAULT NULL,IN "p9To" CHAR(25) DEFAULT NULL,IN "p9Brk" CHAR(20) DEFAULT NULL,IN "p9Qty" CHAR(20) DEFAULT NULL,IN "p9Note" CHAR(50) DEFAULT NULL,
  IN "p10Date" CHAR(25) DEFAULT NULL,IN "p10Event" CHAR(20) DEFAULT NULL,IN "p10From" CHAR(25) DEFAULT NULL,IN "p10To" CHAR(25) DEFAULT NULL,IN "p10Brk" CHAR(20) DEFAULT NULL,IN "p10Qty" CHAR(20) DEFAULT NULL,IN "p10Note" CHAR(50) DEFAULT NULL ) 
RESULT( "pResult" CHAR(250) ) 
BEGIN
  DECLARE "swebusername" CHAR(50);
  DECLARE "CanAuthorise" SMALLINT;
  DECLARE "thelog" long VARCHAR;
  DECLARE LOCAL TEMPORARY TABLE "IDs"(
    "ID" CHAR(20) NULL,
    ) NOT transactional;
  INSERT INTO "IDs"( "ID" ) 
    SELECT DISTINCT "e"."companyid" FROM "iqxnetuserlink" AS "l" KEY JOIN "employment" AS "e" WHERE "l"."iqxnetuserid" = "pWebUserID";
  IF NOT "pvacancyid" = any(SELECT "v"."vacancyid" FROM "vacancy" AS "v" KEY JOIN "employment" AS "e" JOIN "IDs" ON "e"."companyid" = "IDs"."ID") THEN
    SELECT '99:~Permission denied';
    RETURN
  END IF;
  IF "IQXNetHasPermission"("pWebUserID",'ORDERJOBS') = 0 THEN
    SELECT '99:~Permission denied';
    RETURN
  END IF;
  SET "swebusername" = (SELECT "name" FROM "iqxnetuser" WHERE "iqxnetuserid" = "pwebuserid");
  SET "CanAuthorise" = "IQXNetHasPermission"("pWebUserID",'AUTHORISEJOBS');
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p1date"),"pshifttemplateid" = "p1","ptimefrom" = "p1from","ptimeto" = "p1to","pbreak" = "p1brk","pnote" = "p1note","pqty" = "p1qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p2date"),"pshifttemplateid" = "p2","ptimefrom" = "p2from","ptimeto" = "p2to","pbreak" = "p2brk","pnote" = "p2note","pqty" = "p2qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p3date"),"pshifttemplateid" = "p3","ptimefrom" = "p3from","ptimeto" = "p3to","pbreak" = "p3brk","pnote" = "p3note","pqty" = "p3qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p4date"),"pshifttemplateid" = "p4","ptimefrom" = "p4from","ptimeto" = "p4to","pbreak" = "p4brk","pnote" = "p4note","pqty" = "p4qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p5date"),"pshifttemplateid" = "p5","ptimefrom" = "p5from","ptimeto" = "p5to","pbreak" = "p5brk","pnote" = "p5note","pqty" = "p5qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p6date"),"pshifttemplateid" = "p6","ptimefrom" = "p6from","ptimeto" = "p6to","pbreak" = "p6brk","pnote" = "p6note","pqty" = "p6qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p7date"),"pshifttemplateid" = "p7","ptimefrom" = "p7from","ptimeto" = "p7to","pbreak" = "p7brk","pnote" = "p7note","pqty" = "p7qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p8date"),"pshifttemplateid" = "p8","ptimefrom" = "p8from","ptimeto" = "p8to","pbreak" = "p8brk","pnote" = "p8note","pqty" = "p8qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p9date"),"pshifttemplateid" = "p9","ptimefrom" = "p9from","ptimeto" = "p9to","pbreak" = "p9brk","pnote" = "p9note","pqty" = "p9qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  CALL "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p10date"),"pshifttemplateid" = "p10","ptimefrom" = "p10from","ptimeto" = "p10to","pbreak" = "p10brk","pnote" = "p10note","pqty" = "p10qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
  IF "CanAuthorise" = 1 THEN
    CALL "IQXNetPopup"("pWebUserID",NULL,NULL,"pvacancyid",NULL,NULL,'ADDSHIFTS','New shift requirement(s) added',"thelog")
  END IF;
  SELECT '0:~Success'
END
}
  • database/procedures/pears_netcandidateaddeventsmultiday.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1