====== pears.NetQuestionnaire2 ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetQuestionnaire2"( in "pWebUserID" char(20),in "ptaglocation" char(3),in "pid" char(20) default null,in "pgroup" char(25) default null,in "pdoctype" char(25) default null )
result( "tagsortorder" smallint,"taglocation" char(3),"tagid" char(3),"sortX" smallint,"choicesortorder" smallint,"tagchoiceid" char(4),"rectype" smallint,"description" long varchar,"tagtype" char(1),"minstep" double,"units" char(10),"required" smallint,"displaygroup" smallint,"value" double,"textvalue" long varchar,"tagchoiceparentid" char(4),"readonly" smallint )
// IQXWeb
begin
declare "ispublic" smallint;
declare "userclass" char(20);
if "pid" is null then
set "ispublic" = 0;
if "ptaglocation" like '[PA]%' then
set "pid" = "NetCandidateValidPersonID"("pWebUserID","pid")
else if "ptaglocation" = 'E' then
set "pid" = (select first "employmentid" from "iqxnetuserlink" where "iqxnetuserid" = "pwebuserid" and(select "count"() from "iqxnetuserlink" where "iqxnetuserid" = "pwebuserid") = 1 order by 1 asc)
else if "ptaglocation" = 'C' then
set "pid" = (select first "employment"."companyid" from "iqxnetuserlink" key join "employment" where "iqxnetuserlink"."iqxnetuserid" = "pwebuserid" and(select "count"() from "iqxnetuserlink" where "iqxnetuserid" = "pwebuserid") = 1 order by 1 asc)
end if
end if
end if
else set "userclass" = (select first "iqxnetuserclassid" from "iqxnetuser" where "iqxnetuserid" = "pwebuserid");
if "userclass" = 'OWNER' then
set "ispublic" = 0; -- Owner rights to all record types but they only see the data if they have division rights to the record
if "ptaglocation" like '[PA]%' then
set "pid" = (select first "personid" from "person" where "personid" = "pid" and "isnull"("divisionid",'') = any(select "divisionid" from "dashboardstaffdivisions"()))
else if "ptaglocation" = 'E' then
set "pid" = (select first "e"."employmentid" from "employment" as "e" key join "company" as "c" where "e"."employmentid" = "pid" and "isnull"("c"."divisionid",'') = any(select "divisionid" from "dashboardstaffdivisions"()))
else if "ptaglocation" = 'C' then
set "pid" = (select first "companyid" from "company" where "companyid" = "pid" and "isnull"("divisionid",'') = any(select "divisionid" from "dashboardstaffdivisions"()))
end if
end if
end if
else if "userclass" = 'AGENCY' then
set "ispublic" = 0;
if "ptaglocation" like '[PA]%' then
set "pid" = (select first "pe"."personid" from "pay_employee" as "pe" key join "company" key join "employment" key join "iqxnetuserlink" as "x" where "pe"."personid" = "pid" and "x"."iqxnetuserid" = "pwebuserid")
else
set "ispublic" = 1 -- Read only access to web view questions only
end if
else if "userclass" = 'CANDIDATE' then
if "ptaglocation" = 'P' then
set "pid" = "NetCandidateValidPersonID"("pWebUserID","pid")
end if;
set "ispublic" = 0
else
set "ispublic" = 1 -- Read only access to web view questions only
end if end if end if end if;
if "left"("pgroup",1) = '?' then -- If no members in the specified group, fall back on the underlying taglocation
set "pgroup" = "stuff"("pgroup",1,1,null);
if not exists(select * from "iqxNetTagGroupMember" where "iqxNetTagGroupID" = "pgroup") then
set "pgroup" = null
end if end if;
if "pgroup" is null and "pdoctype" is null then
select "tag"."sortorder","tag"."taglocation","tag"."tagid",0 as "sortX",cast(null as smallint),cast(null as char(4)),0 as "rectype","isnull"("tag"."longdescription","tag"."description"),"tag"."tagtype","tag"."minstep","tag"."units",
"tag"."required","isnull"("tag"."displaygroup",0) as "displaygroup",cast(null as double),cast(null as long varchar),
cast(null as char(4)),(if "ispublic" = 1 then 1 else "tag"."readonly" endif) as "readonly"
from "tag" where "tag"."taglocation" = "ptaglocation" and(if "ispublic" = 1 then "tag"."publiconweb" else "tag"."publishtoweb" endif)
= 1 union all
select "tag"."sortorder","tag"."taglocation","tag"."tagid",3-("isnull"("tagchoice"."subchoice",0)+1) as "sortX","tagchoice"."sortorder","tagchoice"."tagchoiceid","isnull"("tagchoice"."subchoice",0)+1 as "rectype",
"isnull"("tagchoice"."longdescription","tagchoice"."description"),null,null,null,null,"isnull"("tag"."displaygroup",0) as "displaygroup","tagchoice"."value",cast(null as long varchar),"tagchoice"."tagchoiceparentid",null
from "tagchoice" key join "tag" where "tag"."taglocation" = "ptaglocation" and(if "ispublic" = 1 then "tag"."publiconweb" else "tag"."publishtoweb" endif)
= 1 and "isnull"("tagchoice"."donotpublishtoweb",0) = 0 union all
select "tag"."sortorder","tag"."taglocation","tag"."tagid",2 as "sortX","tagchoice"."sortorder","tagchoice"."tagchoiceid",3 as "rectype",null,null,null,null,null,
"isnull"("tag"."displaygroup",0) as "displaygroup","tagvalue"."value","tagvalue"."textvalue",null,null
from "tagvalue" key join "tag","tagvalue" key left outer join "tagchoice"
where "tagvalue"."id" = "pid" and "tag"."taglocation" = "ptaglocation" and(if "ispublic" = 1 then "tag"."publiconweb" else "tag"."publishtoweb" endif)
= 1 and "isnull"("tagchoice"."donotpublishtoweb",0) = 0
order by 1 asc,2 asc,3 asc,4 asc,5 asc,6 asc,7 asc
else if "pdoctype" is null then
select "x"."sortorder","tag"."taglocation","tag"."tagid",0 as "sortX",cast(null as smallint),cast(null as char(4)),0 as "rectype","isnull"("x"."description","tag"."longdescription","tag"."description"),"tag"."tagtype","tag"."minstep","tag"."units",
"isnull"("x"."required","tag"."required") as "required","isnull"("tag"."displaygroup",0) as "displaygroup",cast(null as double),cast(null as long varchar),cast(null as char(4)),"isnull"("x"."readonly","tag"."readonly") as "readonly"
from "tag" join "iqxNetTagGroupMember" as "x" on "x"."iqxNetTagGroupID" = "pgroup" and "x"."tagid" = "tag"."tagid" and "x"."taglocation" = "tag"."taglocation"
where "tag"."taglocation" = "NetQuestionOwnerID"("ptaglocation",null,"tag"."taglocation") union all
select "x"."sortorder","tag"."taglocation","tag"."tagid",3-("isnull"("tagchoice"."subchoice",0)+1) as "sortX","tagchoice"."sortorder","tagchoice"."tagchoiceid","isnull"("tagchoice"."subchoice",0)+1 as "rectype",
"isnull"("tagchoice"."longdescription","tagchoice"."description"),null,null,null,null,"isnull"("tag"."displaygroup",0) as "displaygroup","tagchoice"."value",cast(null as long varchar),"tagchoice"."tagchoiceparentid",null
from "tagchoice" key join "tag" join "iqxNetTagGroupMember" as "x" on "x"."iqxNetTagGroupID" = "pgroup" and "x"."tagid" = "tag"."tagid" and "x"."taglocation" = "tag"."taglocation"
where "tag"."taglocation" = "NetQuestionOwnerID"("ptaglocation",null,"tag"."taglocation") and "isnull"("tagchoice"."donotpublishtoweb",0) = 0 union all
select "x"."sortorder","tag"."taglocation","tag"."tagid",2 as "sortX","tagchoice"."sortorder","tagchoice"."tagchoiceid",3 as "rectype",null,null,null,null,null,
"isnull"("tag"."displaygroup",0) as "displaygroup","tagvalue"."value","tagvalue"."textvalue",null,null
from "tagvalue" key join "tag" join "iqxNetTagGroupMember" as "x" on "x"."iqxNetTagGroupID" = "pgroup" and "x"."tagid" = "tag"."tagid" and "x"."taglocation" = "tag"."taglocation"
,"tagvalue" key left outer join "tagchoice"
where "tagvalue"."id" = "NetQuestionOwnerID"("ptaglocation","pid","tag"."taglocation") and "tag"."taglocation" = "NetQuestionOwnerID"("ptaglocation",null,"tag"."taglocation") and "isnull"("tagchoice"."donotpublishtoweb",0) = 0
order by 1 asc,2 asc,3 asc,4 asc,5 asc,6 asc,7 asc
else
select "tag"."sortorder","tag"."taglocation","tag"."tagid",0 as "sortX",cast(null as smallint),cast(null as char(4)),0 as "rectype","isnull"("tag"."longdescription","tag"."description"),"tag"."tagtype","tag"."minstep","tag"."units",
"isnull"("x"."required","tag"."required") as "required","isnull"("tag"."displaygroup",0) as "displaygroup",cast(null as double),cast(null as long varchar),cast(null as char(4)),0 as "readonly"
from "tag" join "DocumentTag" as "x" on "x"."DocumentTypeID" = "pdoctype" and "x"."tagid" = "tag"."tagid" and "x"."taglocation" = "tag"."taglocation"
where "tag"."publishtoweb" = 1 union all
select "tag"."sortorder","tag"."taglocation","tag"."tagid",3-("isnull"("tagchoice"."subchoice",0)+1) as "sortX","tagchoice"."sortorder","tagchoice"."tagchoiceid","isnull"("tagchoice"."subchoice",0)+1 as "rectype",
"isnull"("tagchoice"."longdescription","tagchoice"."description"),null,null,null,null,"isnull"("tag"."displaygroup",0) as "displaygroup","tagchoice"."value",cast(null as long varchar),"tagchoice"."tagchoiceparentid",null
from "tagchoice" key join "tag" join "DocumentTag" as "x" on "x"."DocumentTypeID" = "pdoctype" and "x"."tagid" = "tag"."tagid" and "x"."taglocation" = "tag"."taglocation"
where "tag"."publishtoweb" = 1 and "isnull"("tagchoice"."donotpublishtoweb",0) = 0 union all
select "tag"."sortorder","tag"."taglocation","tag"."tagid",2 as "sortX","tagchoice"."sortorder","tagchoice"."tagchoiceid",3 as "rectype",null,null,null,null,null,
"isnull"("tag"."displaygroup",0) as "displaygroup","tagvalue"."value","tagvalue"."textvalue",null,null
from "tagvalue" key join "tag" join "DocumentTag" as "x" on "x"."DocumentTypeID" = "pdoctype" and "x"."tagid" = "tag"."tagid" and "x"."taglocation" = "tag"."taglocation"
,"tagvalue" key left outer join "tagchoice"
where "tagvalue"."id" = "pid" and "tag"."publishtoweb" = 1 and "isnull"("tagchoice"."donotpublishtoweb",0) = 0
order by 1 asc,2 asc,3 asc,4 asc,5 asc,6 asc,7 asc
end if
end if
end /* DOC
Derived from NetQuestionnaire but with different use of pgroup to allow sub-selection
using the new iqxNetTagGroup system. Where used this disregards publiconweb and publishtoweb
Also added pdoctype to allow compliance questions with document upload
2017-06-09 PC change Description to long varchar to match data type
2017-06-22 PC Test and Doc
2018-06-06 Fix division access for owner logins. Fix tests.
2018-10-22 MHS IW-456 multi-cand fix and tests
*/
/* TEST
call NetTestSetup('');
delete from tag where taglocation='P' and tagid='~~~';
select * from NetQuestionnaire2(null,null,null,null);
expect EOF;
select * from NetQuestionnaire2('test.candidate',null,null,null);
expect EOF;
select * from NetQuestionnaire2('test.candidate','P',null,null) where tagid='~~~';
expect EOF;
insert into tag (tagid,taglocation,tagtype,description,publiconweb,publishtoweb) values ('~~~','P','M','TagDescrip',1,1);
insert into tagchoice (taglocation,tagid,tagchoiceid,description) values ('P','~~~','~','ChoiceDescrip');
insert into tagvalue (taglocation,tagid,tagchoiceid,id) values ('P','~~~','~','TEST');
select * from NetQuestionnaire2('test.candidate','P',null,null) where tagid='~~~';
expect description=TagDescrip, rectype=0;
expect description=ChoiceDescrip, rectype=1;
expect rectype=3;
expect EOF;
select * from NetQuestionnaire2('test.candidate','P',null,'TEST') where tagid='~~~';
expect EOF;
insert into iqxnettaggroup (iqxNetTagGroupID,description) on existing update values ('TEST','Test');
insert into iqxnettaggroupmember (iqxNetTagGroupID,taglocation,tagid) values ('TEST','P','~~~');
select * from NetQuestionnaire2('test.candidate','P',null,'TEST') where tagid='~~~';
expect description=TagDescrip, rectype=0;
expect description=ChoiceDescrip, rectype=1;
expect rectype=3;
expect EOF;
select * from NetQuestionnaire2('test.client','E',null,'TEST') where tagid='~~~';
expect EOF;
select * from NetQuestionnaire2('test.client','C',null,'TEST') where tagid='~~~';
expect EOF;
*/
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetQuestionnaire2" IS
{create PROCEDURE pears."NetQuestionnaire2"(in pWebUserID char(20),in ptaglocation char(3),in pid char(20) default null,in pgroup char(25) default null, in pdoctype char(25) default null)
result(tagsortorder smallint,taglocation char(3),tagid char(3),sortX smallint,choicesortorder smallint,tagchoiceid char(4),rectype smallint,description long varchar,tagtype char(1),minstep double,units char(10),required smallint,displaygroup smallint,value double,textvalue long varchar,tagchoiceparentid char(4),readonly smallint)
// IQXWeb
begin
declare ispublic smallint;
declare userclass char(20);
if pid is null then
set ispublic=0;
if ptaglocation like '[PA]%' then
set pid=NetCandidateValidPersonID(pWebUserID,pid)
else if ptaglocation = 'E' then
set pid=(select first employmentid from iqxnetuserlink where iqxnetuserid = pwebuserid and (select count(*) from iqxnetuserlink where iqxnetuserid = pwebuserid)=1 order by 1)
else if ptaglocation = 'C' then
set pid=(select first employment.companyid from iqxnetuserlink key join employment where iqxnetuserlink.iqxnetuserid = pwebuserid and (select count(*) from iqxnetuserlink where iqxnetuserid = pwebuserid)=1 order by 1)
end if
end if
end if
else
set userclass=(select first iqxnetuserclassid from iqxnetuser where iqxnetuserid = pwebuserid);
if userclass = 'OWNER' then
set ispublic=0; -- Owner rights to all record types but they only see the data if they have division rights to the record
if ptaglocation like '[PA]%' then
set pid=(select first personid from person where personid = pid and isnull(divisionid,'') in (select divisionid from dashboardstaffdivisions()))
else if ptaglocation = 'E' then
set pid=(select first e.employmentid from employment as e key join company as c where e.employmentid = pid and isnull(c.divisionid,'') in (select divisionid from dashboardstaffdivisions()))
else if ptaglocation = 'C' then
set pid=(select first companyid from company where companyid = pid and isnull(divisionid,'') in (select divisionid from dashboardstaffdivisions()))
end if
end if
end if
else if userclass = 'AGENCY' then
set ispublic=0;
if ptaglocation like '[PA]%' then
set pid=(select first pe.personid from pay_employee as pe key join company key join employment key join iqxnetuserlink as x where pe.personid=pid and x.iqxnetuserid=pwebuserid)
else
set ispublic=1 -- Read only access to web view questions only
end if
else if userclass = 'CANDIDATE' then
if ptaglocation = 'P' then
set pid=NetCandidateValidPersonID(pWebUserID,pid);
end if;
set ispublic=0
else
set ispublic=1 -- Read only access to web view questions only
end if
end if
end if
end if;
if left(pgroup,1)='?' then -- If no members in the specified group, fall back on the underlying taglocation
set pgroup=stuff(pgroup,1,1,null);
if not exists(select * from iqxNetTagGroupMember where iqxNetTagGroupID=pgroup) then
set pgroup=null;
end if;
end if;
if pgroup is null and pdoctype is null then
select tag.sortorder,tag.taglocation,tag.tagid,0 as sortX,cast(null as smallint),cast(null as char(4)),0 as rectype,isnull(tag.longdescription,tag.description),tag.tagtype,tag.minstep,tag.units,
tag.required,isnull(tag.displaygroup,0) as displaygroup,cast(null as double),cast(null as long varchar),
cast(null as char(4)),(if ispublic = 1 then 1 else tag.readonly endif) as readonly
from tag where tag.taglocation = ptaglocation and(if ispublic = 1 then tag.publiconweb else tag.publishtoweb
endif) = 1
union all
select tag.sortorder,tag.taglocation,tag.tagid,3-(isnull(tagchoice.subchoice,0)+1) as sortX,tagchoice.sortorder,tagchoice.tagchoiceid,isnull(tagchoice.subchoice,0)+1 as rectype,
isnull(tagchoice.longdescription,tagchoice.description),null,null,null,null,isnull(tag.displaygroup,0) as displaygroup,tagchoice.value,cast(null as long varchar),tagchoice.tagchoiceparentid,null
from tagchoice key join tag where tag.taglocation = ptaglocation and(if ispublic = 1 then tag.publiconweb else tag.publishtoweb
endif) = 1 and isnull(tagchoice.donotpublishtoweb,0) = 0
union all
select tag.sortorder,tag.taglocation,tag.tagid,2 as sortX,tagchoice.sortorder,tagchoice.tagchoiceid,3 as rectype,null,null,null,null,null,
isnull(tag.displaygroup,0) as displaygroup,tagvalue.value,tagvalue.textvalue,null,null
from tagvalue key join tag,tagvalue key left outer join tagchoice
where tagvalue.id = pid and tag.taglocation = ptaglocation and(if ispublic = 1 then tag.publiconweb else tag.publishtoweb
endif) = 1 and isnull(tagchoice.donotpublishtoweb,0) = 0
order by
1 asc,2 asc,3 asc,4 asc,5 asc,6 asc,7 asc
else if pdoctype is null then
select x.sortorder,tag.taglocation,tag.tagid,0 as sortX,cast(null as smallint),cast(null as char(4)),0 as rectype,isnull(x.description,tag.longdescription,tag.description),tag.tagtype,tag.minstep,tag.units,
isnull(x.required,tag.required) as required,isnull(tag.displaygroup,0) as displaygroup,cast(null as double),cast(null as long varchar),cast(null as char(4)),isnull(x.readonly,tag.readonly) as readonly
from tag join iqxNetTagGroupMember x on x.iqxNetTagGroupID=pgroup and x.tagid=tag.tagid and x.taglocation=tag.taglocation
where tag.taglocation = NetQuestionOwnerID(ptaglocation,null,tag.taglocation)
union all
select x.sortorder,tag.taglocation,tag.tagid,3-(isnull(tagchoice.subchoice,0)+1) as sortX,tagchoice.sortorder,tagchoice.tagchoiceid,isnull(tagchoice.subchoice,0)+1 as rectype,
isnull(tagchoice.longdescription,tagchoice.description),null,null,null,null,isnull(tag.displaygroup,0) as displaygroup,tagchoice.value,cast(null as long varchar),tagchoice.tagchoiceparentid,null
from tagchoice key join tag join iqxNetTagGroupMember x on x.iqxNetTagGroupID=pgroup and x.tagid=tag.tagid and x.taglocation=tag.taglocation
where tag.taglocation = NetQuestionOwnerID(ptaglocation,null,tag.taglocation) and isnull(tagchoice.donotpublishtoweb,0) = 0
union all
select x.sortorder,tag.taglocation,tag.tagid,2 as sortX,tagchoice.sortorder,tagchoice.tagchoiceid,3 as rectype,null,null,null,null,null,
isnull(tag.displaygroup,0) as displaygroup,tagvalue.value,tagvalue.textvalue,null,null
from tagvalue key join tag join iqxNetTagGroupMember x on x.iqxNetTagGroupID=pgroup and x.tagid=tag.tagid and x.taglocation=tag.taglocation,
tagvalue key left outer join tagchoice
where tagvalue.id = NetQuestionOwnerID(ptaglocation,pid,tag.taglocation) and tag.taglocation = NetQuestionOwnerID(ptaglocation,null,tag.taglocation) and isnull(tagchoice.donotpublishtoweb,0) = 0 order by
1 asc,2 asc,3 asc,4 asc,5 asc,6 asc,7 asc
else
select tag.sortorder,tag.taglocation,tag.tagid,0 as sortX,cast(null as smallint),cast(null as char(4)),0 as rectype,isnull(tag.longdescription,tag.description),tag.tagtype,tag.minstep,tag.units,
isnull(x.required,tag.required) as required,isnull(tag.displaygroup,0) as displaygroup,cast(null as double),cast(null as long varchar),cast(null as char(4)),0 as readonly
from tag join DocumentTag x on x.DocumentTypeID=pdoctype and x.tagid=tag.tagid and x.taglocation=tag.taglocation
where tag.publishtoweb = 1
union all
select tag.sortorder,tag.taglocation,tag.tagid,3-(isnull(tagchoice.subchoice,0)+1) as sortX,tagchoice.sortorder,tagchoice.tagchoiceid,isnull(tagchoice.subchoice,0)+1 as rectype,
isnull(tagchoice.longdescription,tagchoice.description),null,null,null,null,isnull(tag.displaygroup,0) as displaygroup,tagchoice.value,cast(null as long varchar),tagchoice.tagchoiceparentid,null
from tagchoice key join tag join DocumentTag x on x.DocumentTypeID=pdoctype and x.tagid=tag.tagid and x.taglocation=tag.taglocation
where tag.publishtoweb = 1 and isnull(tagchoice.donotpublishtoweb,0) = 0
union all
select tag.sortorder,tag.taglocation,tag.tagid,2 as sortX,tagchoice.sortorder,tagchoice.tagchoiceid,3 as rectype,null,null,null,null,null,
isnull(tag.displaygroup,0) as displaygroup,tagvalue.value,tagvalue.textvalue,null,null
from tagvalue key join tag join DocumentTag x on x.DocumentTypeID=pdoctype and x.tagid=tag.tagid and x.taglocation=tag.taglocation,
tagvalue key left outer join tagchoice
where tagvalue.id = pid and tag.publishtoweb = 1 and isnull(tagchoice.donotpublishtoweb,0) = 0 order by
1 asc,2 asc,3 asc,4 asc,5 asc,6 asc,7 asc
end if;
end if;
end
/* DOC
Derived from NetQuestionnaire but with different use of pgroup to allow sub-selection
using the new iqxNetTagGroup system. Where used this disregards publiconweb and publishtoweb
Also added pdoctype to allow compliance questions with document upload
2017-06-09 PC change Description to long varchar to match data type
2017-06-22 PC Test and Doc
2018-06-06 Fix division access for owner logins. Fix tests.
2018-10-22 MHS IW-456 multi-cand fix and tests
*/
/* TEST
call NetTestSetup('');
delete from tag where taglocation='P' and tagid='~~~';
select * from NetQuestionnaire2(null,null,null,null);
expect EOF;
select * from NetQuestionnaire2('test.candidate',null,null,null);
expect EOF;
select * from NetQuestionnaire2('test.candidate','P',null,null) where tagid='~~~';
expect EOF;
insert into tag (tagid,taglocation,tagtype,description,publiconweb,publishtoweb) values ('~~~','P','M','TagDescrip',1,1);
insert into tagchoice (taglocation,tagid,tagchoiceid,description) values ('P','~~~','~','ChoiceDescrip');
insert into tagvalue (taglocation,tagid,tagchoiceid,id) values ('P','~~~','~','TEST');
select * from NetQuestionnaire2('test.candidate','P',null,null) where tagid='~~~';
expect description=TagDescrip, rectype=0;
expect description=ChoiceDescrip, rectype=1;
expect rectype=3;
expect EOF;
select * from NetQuestionnaire2('test.candidate','P',null,'TEST') where tagid='~~~';
expect EOF;
insert into iqxnettaggroup (iqxNetTagGroupID,description) on existing update values ('TEST','Test');
insert into iqxnettaggroupmember (iqxNetTagGroupID,taglocation,tagid) values ('TEST','P','~~~');
select * from NetQuestionnaire2('test.candidate','P',null,'TEST') where tagid='~~~';
expect description=TagDescrip, rectype=0;
expect description=ChoiceDescrip, rectype=1;
expect rectype=3;
expect EOF;
select * from NetQuestionnaire2('test.client','E',null,'TEST') where tagid='~~~';
expect EOF;
select * from NetQuestionnaire2('test.client','C',null,'TEST') where tagid='~~~';
expect EOF;
*/
}