====== pears.NetVacancyDocuments ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetVacancyDocuments"( in "pWebUserID" char(20),in "pVacID" char(20) default null )
result( "DocType" char(50),"DocDescription" char(50),"LastUpdate" timestamp,"SpecialType" char(50),"DocumentID" char(20),"OwnerID" char(20),"SortOrder" integer ) -- 20120814 download placement documents for current opportunities
begin
declare "userClass" char(20);
declare "isCandorAgency" smallint;
if "iqxnethaspermission"("pwebuserid",'DOCVACDOWNLOAD') = 0 then
set "pVacID" = null
else
select "isnull"("nullif"("upper"("oledocument"."fileextension"),''),'MS Office') as "DocType",
"oledocument"."description" as "DocDescription",
"isnull"("blobstore"."changedat","blobstore"."createdat") as "LastUpdate",'' as "SpecialType",
"oledocument"."oledocumentid" as "DocumentID",
"oledocument"."ownerid" as "OwnerID",'1' as "SortOrder"
from "oledocument"
join "blobstore" on "blobstore"."id" = "oledocument"."oledocumentid" and "blobstore"."class" = 'O',"oledocument"
where "oledocument"."ownertype" = 'V'
and "oledocument"."ownerid" = "pVacID"
and("oledocument"."rawfile" = 1 or "blobstore"."zipped" = 2)
and "blobstore"."publishtoweb" = 1
order by "LastUpdate" asc
end if
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetVacancyDocuments" IS
{create procedure pears."NetVacancyDocuments"( in "pWebUserID" char(20),in "pVacID" char(20) default null )
result( "DocType" char(50),"DocDescription" char(50),"LastUpdate" timestamp,"SpecialType" char(50),"DocumentID" char(20),"OwnerID" char(20),"SortOrder" integer ) -- 20120814 download placement documents for current opportunities
begin
declare "userClass" char(20);
declare "isCandorAgency" smallint;
if "iqxnethaspermission"("pwebuserid",'DOCVACDOWNLOAD') = 0 then
set "pVacID" = null
else
select "isnull"("nullif"("upper"("oledocument"."fileextension"),''),'MS Office') as "DocType",
"oledocument"."description" as "DocDescription",
"isnull"("blobstore"."changedat","blobstore"."createdat") as "LastUpdate",'' as "SpecialType",
"oledocument"."oledocumentid" as "DocumentID",
"oledocument"."ownerid" as "OwnerID",'1' as "SortOrder"
from "oledocument"
join "blobstore" on "blobstore"."id" = "oledocument"."oledocumentid" and "blobstore"."class" = 'O',"oledocument"
where "oledocument"."ownertype" = 'V'
and "oledocument"."ownerid" = "pVacID"
and("oledocument"."rawfile" = 1 or "blobstore"."zipped" = 2)
and "blobstore"."publishtoweb" = 1
order by "LastUpdate" asc
end if
end
}