====== pears.CollectionsGetRecord ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."CollectionsGetRecord"(
/* Application Maintained Function / Procedure - DO NOT EDIT*/
in "pCollectionID" char(20) )
result( "CollectionID" char(20),"Parent" char(20),"Name" char(60),"StaffID" char(20),"IDType" char(2),"ID" char(20),
"CollectionTypeID" char(20),"WhenCreated" timestamp,"WhoCreated" char(20),"WhenArchived" timestamp,"WhoArchived" char(20),
"DateFrom" date,"DateTo" date,"Notes" long varchar,"OtherNotes" long varchar,"SortOrder" integer,"IsTemplate" smallint,
"ItemTypeDescription" char(20),"ItemDescription" char(250),"ParentType" char(1),"ParentDescription" char(250),"CollectionTagLocation" char(3) )
begin
select "CollectionID","Parent","collection"."Name","staffid","IDType","ID","collection"."CollectionTypeID","WhenCreated",
"WhoCreated","WhenArchived","WhoArchived","DateFrom","DateTo","Notes","OtherNotes","collection"."sortorder","IsTemplate",
"CollectionGetItemTypeName"("idtype") as "ItemTypeDescription",
"CollectionItemDescription"("collectionid","idtype","id") as "ItemDescription",
(select "IDType" from "collection" as "cc" where "cc"."collectionid" = "collection"."parent") as "ParentType",
"CollectionItemDescription"("collectionid","Parenttype","Parent") as "ParentDescription",
"string"('J',"collectiontype"."QuestionLink") as "CollectionTagLocation"
from "pears"."Collection" key join "collectiontype" where "collectionID" = "pCollectionID" order by "collection"."sortorder" asc
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."CollectionsGetRecord" IS
{create procedure CollectionsGetRecord
/* Application Maintained Function / Procedure - DO NOT EDIT*/
(in pCollectionID char(20))
RESULT( CollectionID char(20),Parent char(20),Name char(60),StaffID char(20),IDType char(2),ID char(20),
CollectionTypeID char(20),WhenCreated timestamp,WhoCreated char(20),WhenArchived timestamp,WhoArchived char(20),
DateFrom date,DateTo date,Notes long varchar,OtherNotes long varchar,SortOrder Integer,IsTemplate smallint,
ItemTypeDescription char(20),ItemDescription char(250), ParentType char(1), ParentDescription char(250), CollectionTagLocation char(3))
begin
select CollectionID,Parent,collection.Name,staffid,IDType,ID,collection.CollectionTypeID,WhenCreated,
WhoCreated,WhenArchived,WhoArchived,DateFrom,DateTo,Notes, OtherNotes,collection.sortorder,IsTemplate,
CollectionGetItemTypeName (idtype) as ItemTypeDescription ,
CollectionItemDescription (collectionid, idtype, id) as ItemDescription,
(select IDType from collection cc where cc.collectionid = collection.parent) as ParentType,
CollectionItemDescription (collectionid, Parenttype, Parent) as ParentDescription,
string('J',collectiontype.QuestionLink) as CollectionTagLocation
FROM "pears".Collection key join collectiontype where collectionID = pCollectionID order by collection.sortorder
end
}