====== pears.GetPropertiesText ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."GetPropertiesText" IS
{create function GetPropertiesText
/* Application Maintained Function / Procedure - DO NOT EDIT*/
(
in "PropertyType" char(1),in "HeaderText" long varchar,in "ConID" integer )
returns long varchar
begin
-- PropertyType - C for connection (requires connectionid), D for database, E for engine / server, W engine / server window messages
declare "PropsText" long varchar;
declare "NewLine" char(2);
declare "Tab" char(1);
set "NewLine" = "char"(13)+"char"(10);
set "Tab" = "char"(9);
case "PropertyType"
when 'C' then
select "list"("string"("PropName",' = ',"Value","Tab",'(',"PropDescription",')'),"NewLine" order by "PropName" asc) into "PropsText" from "sa_conn_properties_by_name"("ConID")
when 'D' then
select "list"("string"("PropName",' = ',"Value","Tab",'(',"PropDescription",')'),"NewLine" order by "PropName" asc) into "PropsText" from "sa_db_properties"("DB_ID"())
when 'E' then
select "list"("string"("PropName",' = ',"Value","Tab",'(',"PropDescription",')'),"NewLine" order by "PropName" asc) into "PropsText" from "sa_eng_properties"()
when 'W' then
select "list"("string"("dateformat"("msg_time",'yyyy-mm-dd hh:nn:ss'),"Tab","msg_text"),"NewLine" order by "msg_id" asc) into "PropsText" from "sa_server_messages"()
end case;
return("trim"("HeaderText" || "NewLine" || "NewLine" || "PropsText"))
end
}