Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************************
- tbTaskVW.sql
- A collection of procedures related to View. Please follow this cnonvestional here.
- 2 functions as mandatory for view :-
- - Prepare data for VIEW. Function name must be formated "Schema".tablenameVWM_UserData( ... )
- - Update data fro VIEW. Function name must
- Wutirkai Pornchai
- 2015-10-21
- *****************************************************************/
- /******************************************
- View Procedures
- *******************************************/
- -- * Data selected for underlying user
- drop function if exists "dbUserAccReg".tbTaskVW_UserData ( in UserID int , in AccID int ) cascade;
- create or replace FUNCTION "dbUserAccReg".tbTaskVW_UserData ( in UserID int , in AccID int )
- returns table (
- id int
- --* Project mandatory
- ,title text
- --,Duration int
- ,Duration interval
- ,StartDate date
- ,FinishDate date
- ,Complete numeric -- "dbSys".Percent -- num
- ,ActualStart date
- ,ActualFinish date
- ,ActualComplete numeric -- "dbSys".Percent --num
- ,PredecessorID int
- ,Resources text
- ,Tags text
- ,ManDay text
- ,Remark text
- --*
- ,DBSchema text
- ,DBTable text
- ,DBFunction text
- --*
- ,Project text
- ,UID int
- ,ACC int
- ,PID int
- ,IDGrp int
- ,gpr text
- --,planCalTaskID int
- ,ActualCalTaskID int
- ,dis smallint
- ,orderno smallint
- ,fqty smallint
- ,path int[]
- --* ancestor
- ,CalenNameID int
- ,tasktypeid int
- ,venue text
- ,description text
- ,WholeDay boolean
- ,part_ids int[] -- array of contact id
- ,part_names text
- , SenderID int
- , receiverID int
- , ResponsibleID int
- --* Extend ------
- ,privilege text
- -- ,ProductTitle text
- --,Lookup text
- --,FileName text
- --,orderno smallint
- ,ViewID int
- ) AS $$
- declare sql text; foundACC int;
- begin
- return query
- select
- a.*
- --* Extend ------------
- ,a01.tvalue privilege
- -- ,a02.tvalue FileName
- -- ,"dbSys".grpGetValues( c.invenid,'"dbInventory".tbinven','title' )
- --,aa.orderno
- ,a02.tvalue::int viewid
- from
- "dbPM".tbTaskVW_UserData ( UserID , AccID ) a
- -- left join "dbUserAccReg".tbtskpriv b on (b.pid = a.id )
- left join "dbPM".tbTkField a01 on (a01.pid = a.id and a01.Title = 'Custom' and a01.TCustom = 'privilege' )
- left join "dbPM".tbTkField a02 on (a02.pid = a.id and a02.Title = 'Custom' and a02.TCustom = 'ViewID' )
- --left join "dbPM".tbproject c on (c.id= a.pid )
- -- left join "dbPM".tbTkField a02 on (a02.pid = a.id and a02.Title = 'Custom' and a02.TCustom = 'FileName' )
- --left join "dbPM".tbtask aa on (aa.id=a.id )
- ;
- end;
- $$ LANGUAGE plpgsql ;
- /***************************
- Function : Get hierarch task data
- Wut, 2016-08-23
- *********************************/
- drop function if exists "dbUserAccReg".tbTaskVW_getdata (
- in newprojectid int
- ,in prodgroupid int
- ,in taskid int
- );
- create or replace function "dbUserAccReg".tbTaskVW_getdata (
- in newprojectid int
- ,in prodgroupid int
- ,in newuid int
- ,in newacc int
- ,in taskid int = null
- )
- returns table(
- id int
- ,title text
- ,privilege text -- tags
- ,edition text
- ,viewRegistrationID int
- ,viewRegistrationID_Top int
- ,pid int -- prodgroupid, task for group, not product id , from 2nd input parameter
- ,dis smallint
- ,path int[]
- ,no text
- ,taskid_grp int
- ,remark text
- ,consint text
- ,idgrp int
- ) as $$
- begin
- return query
- select
- a.id
- --,e.title
- ,a.title
- ,a01.tvalue privilege -- tags
- ,b.tags edition
- ,d.id viewRegistrationID
- ,d11.id viewRegistrationID_Top
- ,prodgroupid pid -- task for group, not product id
- ,a.dis
- ,z.path
- ,c.no
- ,a.id taskid_grp
- ,a1.tvalue remark
- ,a2.consint
- ,a.idgrp
- from "dbPM".tbtask a
- left join "dbPM".tbtkfield a1 on a1.pid =a.id and a1.title = 'Remark'
- --* constraint
- left join (
- select
- aa.id
- ,string_agg( aa1.tvalue, ',' ) consint
- from "dbPM".tbtask aa
- left join "dbSys".grpDelete_GetChild( aa.id ,'"dbPM".tbtask' ) bb on bb.idgrp = aa.id
- left join "dbPM".tbtkfield aa1 on aa1.pid =bb.id and aa1.title = 'Remark'
- left join "dbPM".tbTask_resources(bb.id) aa2 on aa2.id = bb.id
- where aa.pid = newprojectid
- and aa2.val is not null
- --and position('F' in aa2.val ) > 0
- and ExistStr('F', aa2.val::text ) > 0
- --and case when aa2.val is null then false else ExistStr('F', aa2.val ) > 0 end
- --and ( position ( 'F' in "dbPM".tbTask_TagNames( bb.id, '"dbPM".tbTKTag', '"dbPM".tbpjtag' ) )>0 )
- -- and case when aa2.val is not null then position('F' in aa2.val ) > 0 else false end
- group by aa.id
- ) a2 on a2.id =a.id
- left join "dbPM".tbProject a3 on ( a3.id= a.pid )
- left join "dbPM".tbTask_TagNamesII( a.id, '"dbPM".tbTKTag', '"dbPM".tbpjtag' ) b on (b.id = a.id )
- left join "dbInventory".tbinven c on (c.id = a3.invenid) -- new.invenid )
- right join "dbSys".grpGetData( newuid, newacc, '"dbPM".tbtask' ,_pid:=newprojectid , path_only:=true ) z on ( z.id=a.id )
- left join "dbPM".tbTkField a01 on (a01.pid = a.id and a01.Title = 'Custom' and a01.TCustom = 'privilege' )
- left join "dbPM".tbTkField a0301 on (a0301.pid = a.id and a0301.Title = 'DB Schema' )
- left join "dbPM".tbTkField a0302 on (a0302.pid = a.id and a0302.Title = 'DB Table' )
- left join "dbSys".tbviewregistration d on (d.sch = a0301.tvalue and d.nam = a0302.tvalue )
- left join "dbSys".tbtblregis d1 on ( d1.id = d.id )
- left join "dbSys".tbviewregistration d11 on (d11.id = d1.tblregisid_top )
- -- left join "dbCalen".tbcaltask e on e.id = a.plancaltaskid
- where a.pid = newprojectid
- -- and case when b.tags is null then true else position ('F' in b.tags )=0 end
- and case when taskid is null then true else a.id = taskid end
- order by z.path ;
- end $$ language plpgsql;
- -- * How to update underlying tables whose data is projected to this view
- drop function if exists "dbUserAccReg".tbTaskVW_UpdData() cascade;
- create or replace function "dbUserAccReg".tbTaskVW_UpdData()
- returns trigger as $$
- declare viewreg record; oldd record;
- sql text; sql1 text;
- rec record;
- const_ar text[];
- const text;
- const_key text;
- const_dup_c int;
- prodtask record;
- err text;
- begin
- -- raise notice '92 %, %', TG_NAME, TG_OP;
- if (TG_OP = 'INSERT') then
- if new.tags is not null then
- perform "dbUserAcc".tbprod_validateEditions( new.tags, warning := true );
- end if;
- -- raise notice '224 new.id %, new.idgrp %, new.pid %', new.id,new.idgrp, new.pid;
- if (new.dbSchema is not null ) and (new.dbtable is not null) then
- select a.id,a.sch,a.nam from "dbSys".tbviewregistration a
- where a.sch = trim(new.dbschema) and a.nam = lower(trim(new.dbtable))
- into viewreg;
- if viewreg.id is null then
- raise exception '%',format('No datasource "%s".%s',new.dbschema, new.dbtable);
- else
- select viewreg.sch, viewreg.nam, viewreg.id into new.dbschema, new.dbtable, new.viewid;
- select null::text dbschema , null::text dbtable, null::text viewid into oldd;
- perform "dbContact".updContactChild( '"dbPM".tbTkField', NEW.id ,'DB Schema', null,OLDd.DBSchema,NEW.DBSchema,'TValue' );
- perform "dbContact".updContactChild( '"dbPM".tbTkField', NEW.id ,'DB Table', null,OLDd.DBTable,NEW.DBTable,'TValue' );
- perform "dbContact".updContactChild( '"dbPM".tbTkField', NEW.id ,'Custom', 'ViewID',oldd.viewid::text,new.viewid::text ,'TValue' );
- end if;
- end if;
- if new.privilege is null then
- if new.idgrp is not null then
- select tvalue from "dbPM".tbtkfield where pid=new.idgrp and title='Custom' and tcustom='privilege'
- into new.privilege;
- end if;
- end if;
- if new.privilege is not null then
- insert into "dbPM".tbtkfield (title,tcustom, tvalue,pid) values ( 'Custom','privilege',new.privilege, new.id );
- end if;
- --* Updating by insert to system product directly -------------
- --raise notice '287 start' ;
- if new.idgrp is null then
- select
- b.*
- ,null::text consint_grp
- ,c2.id produgroupid
- from
- "dbPM".tbtask a
- left join "dbPM".tbProject c on ( c.id= a.pid )
- left join "dbUserAcc".tbprod c2 on (c2.title = "dbSys".grpGetValues( c.invenid, '"dbInventory".tbinven', 'title' ) ) -- 4
- left join "dbUserAccReg".tbTaskVW_getdata (
- new.pid -- projectid
- ,c2.id -- prodgroupid
- ,new.uid
- ,new.acc
- ,taskid := new.id
- ) b on b.id = a.id
- where a.id = new.id
- into rec;
- -- raise notice '305 new.id %,new.pid %, rec.produgroupid %, rec.pid %', new.id ,new.pid, rec.produgroupid, rec.pid ;
- else
- --if new.idgrp is not null then
- sql := format(
- 'select
- b.*
- ,d.consint consint_grp
- ,c2.id produgroupid
- from
- "dbPM".tbtask a
- left join "dbPM".tbProject c on ( c.id= a.pid )
- left join "dbUserAcc".tbprod c2 on (c2.title = "dbSys".grpGetValues( c.invenid, %L, %L ) ) -- A
- left join "dbUserAccReg".tbTaskVW_getdata (
- %s -- projectid B
- ,c2.id -- prodgroupid B.1
- ,%s -- C
- ,%s -- D
- ,taskid := a.id
- ) b on b.id = a.id
- left join "dbUserAccReg".tbTaskVW_getdata (
- %s -- new.projectid E
- ,c2.id -- prodgroupid E.1
- ,%s -- F
- , %s -- G
- %s -- taskid = 55 -- H
- )d on d.id = a.idgrp
- where a.id = %s --I
- '
- , '"dbInventory".tbinven' , 'title' -- A
- , new.pid -- B
- , new.uid -- C
- , new.acc -- D
- , new.pid -- E
- , new.uid -- F
- , new.acc -- G
- , case when new.idgrp is null then '' else ',taskid := '|| new.idgrp end --quote_nullable( new.idgrp ) -- H
- , new.id -- I
- );
- --raise notice '351 sql=%', sql;
- execute sql into rec;
- --raise notice '311 new.pid %, new.tags %, rec.pid %, rec.title %, rec.remark %, rec.consint_grp %, rec.produgroupid %',new.pid, new.tags, rec.pid, rec.title , rec.remark, rec.consint_grp, rec.produgroupid;
- end if;
- --if true then
- if (rec.pid is not null) then
- --if (rec.pid is not null) and (rec.consint_grp is not null ) then
- --* Remove
- --* check duplication , if it's feature with remark -----------------
- if --(position('F' in new.tags )>0)
- ( ExistStr('F', new.tags ) > 0) and (new.remark is not null ) then
- const_dup_c := 0;
- const_ar := string_to_array(rec.consint_grp,',' );
- if const_ar is not null then
- foreach const in array const_ar loop
- const_key := trim(split_part(const , '=', 1 ));
- --raise notice '334 rec.consint_grp %, const_key %, new.remark %, position=%',rec.consint_grp, const_key, new.remark ,position ( const_key in new.remark ) ;
- if position ( const_key in new.remark ) > 0 then
- const_dup_c := const_dup_c + 1;
- if const_dup_c > 1 then
- -- raise exception '%', format('Constraint "%s" is already exist,"%s"',new.remark, rec.consint_grp); -- 89
- err := 'Constraint "%s" is already exist,"%s"';
- select msg from "dbSys".sysCallErrMsg(
- 89
- ,null -- talbename = description
- ,null -- new.id
- ,null -- NEW.uID
- ,errmsg := err
- )
- into err;
- raise exception '%', format(err,new.remark, rec.consint_grp );
- end if;
- end if;
- end loop;
- end if;
- end if;
- --* insert to system product
- insert into "dbUserAcc".tbprodtask ( pid, title,privilege,edition, viewRegistrationID, dis, path
- ,viewRegistrationID_top
- ,remark
- ,taskid
- ,idgrp
- )
- select rec.pid, rec.title, rec.privilege, rec.edition, rec.viewRegistrationID, rec.dis, rec.path
- ,rec.viewRegistrationID_Top
- ,new.remark
- ,new.id
- ,new.idgrp
- returning id, title into prodtask;
- -- raise notice '363 rec.pid %, new.idgrp %, rec.consint_grp %,prodtask.id %, prodtask.title %', rec.pid, new.idgrp, rec.consint_grp, prodtask.id, prodtask.title;
- --* Update to group in produc task
- update "dbUserAcc".tbprodtask set consint = rec.consint_grp where pid = rec.pid and taskid = new.idgrp;
- --*
- /*
- raise notice '197, rec.taskid_grp %,new.title = %, position(F in new.title )=%', rec.taskid_grp,new.title, position('F' in new.title );
- if (position('F' in new.tags )>0 ) and (new.remark is not null) and (rec.taskid_grp is not null) then
- raise notice 'ok';
- update "dbUserAcc".tbprodtask set remark = concat_ws(',' ,rec.remark_grp, new.remark )
- where taskid = rec.taskid_grp and position(new.remark in rec.remark_grp) =0;
- end if; */
- --* insert to system user product -----
- sql := format(
- 'select
- %s taskid -- 1
- ,a.id pid
- ,a.no
- from
- "dbUserAccReg".tbuserprod a
- left join "dbPM".tbproject b on b.id = %s -- 1.1
- where
- a.inven_idgrp = b.invenid -- 2
- and a.prodeditionid is not null
- '
- ,new.id -- 1
- ,new.pid -- 1.1
- );
- -- raise notice '435, sql=%', sql;
- for rec in execute sql
- loop
- -- raise notice '438 rec.no %, rec.taskid %, rec.pid %', rec.no, rec.taskid, rec.pid;
- insert into "dbUserAccReg".tbuserprdmenu ( taskid, pid ) values (rec.taskid, rec.pid);
- end loop;
- end if;
- -----------------------
- --raise notice '436 dbUserAccReg.tbtask new.id %', new.id;
- return NEW;
- elseif (TG_OP = 'UPDATE') then
- if diff(OLD.orderno, NEW.orderno) or diff(OLD.idgrp, NEW.idgrp) then
- --* changes - order no
- if diff(OLD.orderno, NEW.orderno) then
- execute format('select "dbSys".grpChangeOrderNo(%s,%s::smallint,%L)',new.id,new.orderno,'"dbPM".tbtask');
- end if;
- --* update path /dis
- select path, dis from "dbSys".grpGetData( new.uid,new.acc, '"dbPM".tbtask', _pid:= new.pid )
- where id = new.id
- into new.path, new.dis;
- end if;
- if new.tags is not null then
- --if diff(old.tags, new.tags) then
- perform "dbUserAcc".tbprod_validateEditions( new.tags, warning := true );
- end if;
- perform "dbContact".updContactChild( '"dbPM".tbTkField', NEW.id ,'Custom', 'privilege',OLD.privilege,NEW.privilege,'TValue' );
- --perform "dbContact".updContactChild( '"dbPM".tbTkField', NEW.id ,'Custom', 'FileName',OLD.FileName,NEW.FileName,'TValue' );
- --* Changes to system product
- sql := null;
- sql := "dbSys".sqlSetValue( OLD.title, NEW.title, sql,'title' );
- sql := "dbSys".sqlSetValue( OLD.privilege, NEW.privilege, sql,'privilege' );
- sql := "dbSys".sqlSetValue( OLD.tags, NEW.tags, sql,'edition' );
- sql := "dbSys".sqlSetValue( OLD.path, NEW.path, sql,'path' );
- sql := "dbSys".sqlSetValue( OLD.dis, NEW.dis, sql,'dis' );
- sql := "dbSys".sqlSetValue( OLD.remark, NEW.remark, sql,'remark' );
- sql := "dbSys".sqlSetValue( OLD.idgrp, NEW.idgrp, sql,'idgrp' );
- --raise notice '404,OLD.tags %, NEW.tags %, new.idgrp %, sql=%', OLD.tags, NEW.tags,new.idgrp , sql;
- if (sql is not null) then
- sql1 := format ( '
- select
- b.*
- ,d.consint consint_grp
- ,c2.id prodgroupid
- from
- "dbPM".tbtask a
- left join "dbPM".tbProject c on ( c.id= a.pid )
- left join "dbInventory".tbinven c1 on (c1.id = c.invenid )
- left join "dbUserAcc".tbprod c2 on (c2.title = "dbSys".grpGetValues( c.invenid, %L,%L ) ) -- 4
- left join "dbUserAccReg".tbTaskVW_getdata (
- %s -- 5 new.projectid
- ,c2.id -- prodgroupid
- ,%s -- 6
- ,%s -- 7
- ,taskid := %s -- 8 new.id
- ) b on b.id = a.id
- left join "dbUserAccReg".tbTaskVW_getdata (
- %s -- 9 new.pid -- new.projectid
- ,c2.id -- prodgroupid
- ,%s -- new.uid 10
- ,%s -- new.acc 11
- %s -- taskid := -- 12 new.idgrp
- )d on d.id = a.idgrp
- where a.id = %s -- new.id -- 13
- '
- ,'"dbInventory".tbinven', 'title' -- 4
- , new.pid -- 5
- , new.uid -- 6
- , new.acc -- 7
- , new.id -- 8
- , new.pid -- 9
- , new.uid -- 10
- , new.acc -- 11
- , case when new.idgrp is null then '' else ',taskid := '|| new.idgrp end -- new.idgrp -- 12
- , new.id -- 13
- );
- -- raise notice '557 sql1=%',sql1;
- execute sql1
- into rec;
- --raise notice '481 new.id %, prodgroupid %, rec.pid %, rec.title %, rec.remark %, rec.consint_grp %',new.id,rec.prodgroupid, rec.pid, rec.title , rec.remark, rec.consint_grp;
- --* fatal error
- /*
- if rec.prodgroupid is null then
- raise exception 'Can not get product group, sql1=%', sql1;
- end if; */
- begin
- execute format('
- update "dbUserAcc".tbprodtask %s where pid = %s and taskid = %s
- ',sql
- ,rec.prodgroupid
- ,new.id
- );
- exception when others then
- raise exception 'Error,% sql1=%'
- ,case
- when rec.prodgroupid is null then 'Product Group is null'
- when new.idgrp is null then format( 'IDGRP is null, id "%s"', new.id )
- else ''
- end
- ,sql1;
- end ;
- --*
- /*
- execute format(
- 'update "dbUserAcc".tbprodtask %s -- 1
- where title= %L and pid in ( -- 1.1
- select prodid_idgrp from "dbUserAccReg".tbuserprod where inven_idgrp = (
- select invenid from "dbPM".tbproject where id = %s -- 2
- )
- )', sql -- 1
- ,old.title -- 1.1
- ,new.pid -- 2
- ); */
- ---* Update to system product task
- /*
- --** Get total remark belongs to parent of this child
- sql := format( '
- select
- bb.idgrp id_grp
- ,string_agg( aa1.tvalue, %L ) consint -- 1
- from "dbPM".tbtask aa
- left join "dbSys".grpDelete_GetChild( aa.id , %L ) bb on bb.idgrp = aa.id -- a
- left join "dbPM".tbtkfield aa1 on aa1.pid =bb.id and aa1.title = %L -- b
- where aa.pid = %s -- c
- and bb.idgrp = (select idgrp from "dbPM".tbtask where id = %s ) -- d
- group by bb.idgrp
- '
- , ',' -- 1
- ,'"dbPM".tbtask' --- a
- ,'Remark' -- b
- , new.pid -- c
- , new.id -- d
- );
- raise notice '258 , sql=%s', sql;
- execute sql into rec;
- --** then update to product task of paraent of this child, if any
- if rec.id_grp is not null then
- sql := format ( 'update "dbUserAcc".tbprodtask set consint = %L where taskid = %s'
- ,rec.consint , rec.id_grp
- );
- execute sql;
- end if; */
- --* Update constratin to group in produc task
- --if (position('F' in new.tags )>0) and (new.remark is not null ) then
- if (rec.pid is not null ) and (new.idgrp is not null) then
- update "dbUserAcc".tbprodtask set consint = rec.consint_grp
- where
- pid = rec.prodgroupid
- and taskid = new.idgrp;
- end if;
- end if;
- --raise notice '258 , sql=%s', sql;
- --* Refresh view, if edition / privilege change
- if diff(OLD.privilege, NEW.privilege) or diff(OLD.tags, NEW.tags) then
- -- raise notice '245';
- update "dbUserAccReg".tbuserprdmenu set sql_CreateView = null where taskid = new.id and (uid= userid);
- end if;
- return NEW;
- elseif TG_OP = 'DELETE' then
- --* clear constrain by making it null befoer really delete it
- update "dbPM".tbtkfield set tvalue = null where pid = old.id and title = 'Remark';
- --* get data
- select
- b.*
- ,d.consint consint_grp
- ,c2.id prodgroupid
- ,d.id id_grp
- ,d.pid prodgroupid_grp
- from
- "dbPM".tbtask a
- left join "dbPM".tbProject c on ( c.id= a.pid )
- left join "dbInventory".tbinven c1 on (c1.id = c.invenid )
- left join "dbUserAcc".tbprod c2 on (c2.title = "dbSys".grpGetValues( c.invenid, '"dbInventory".tbinven', 'title' ) ) -- 4
- left join "dbUserAccReg".tbTaskVW_getdata (
- old.pid -- new.projectid
- ,c2.id -- prodgroupid
- ,old.uid
- ,old.acc
- ,taskid := old.id
- ) b on b.id = a.id
- left join "dbUserAccReg".tbTaskVW_getdata (
- old.pid -- new.projectid
- ,c2.id -- prodgroupid
- ,old.uid
- ,old.acc
- ,taskid := old.idgrp
- )d on d.id = a.idgrp
- where a.id = old.id
- into rec;
- -- raise notice '543 prodgroupid %, rec.pid %, rec.title %, rec.remark %, rec.consint_grp %, rec.prodgroupid_grp % rec.id_grp %',rec.prodgroupid, rec.pid, rec.title , rec.remark, rec.consint_grp, rec.prodgroupid_grp, rec.id_grp;
- --* update product task
- update "dbUserAcc".tbprodtask set consint = rec.consint_grp where pid = rec.prodgroupid_grp and taskid = rec.id_grp;
- --* delete from system user product
- sql := format(
- 'delete from "dbUserAccReg".tbuserprdmenu where taskid = %s'
- ,old.id
- );
- -- raise notice '247, SQL=%', sql;
- execute sql;
- --*
- -- * delete from system product menu
- execute format(
- 'delete from "dbUserAcc".tbprodtask
- where title= %L and pid in ( -- 1.1
- select prodid_idgrp from "dbUserAccReg".tbuserprod where inven_idgrp = (
- select invenid from "dbPM".tbproject where id = %s -- 2
- )
- )'
- ,old.title -- 1.1
- ,old.pid -- 2
- );
- return OLD;
- end if;
- end ; $$ LANGUAGE plpgsql;
- select "dbSys".viewRegistration( '"dbUserAccReg".tbTaskvw'
- , pers := '"dbPM".tbTask'
- --, _delete_system_data := false
- --,_init_data := true, _init_data_uid := varint('userid') ,_init_data_acc := null
- --,_init_data := true, _init_data_uid := varint('userid') ,_init_data_acc := varint('accid')
- -- , _init_sysorg := true
- -- ,_init_count := 'c_task'
- -- ,_fnCheckPost := 'sumamt' -- Field to check cannot be changed when refered by posting data source
- );
- /************************************************************
- Registration : inherite the standard project task
- *************************************************************/
- select "dbSys".tblRegistration_Inherit( '"dbUserAccReg".tbTaskVW', '"dbPM".tbTaskVW', false,false,true );
- /*****************************
- View registration
- ******************************/
- /*
- select "dbSys".viewRegistration( '"dbUserAccReg".tbTaskvw'
- , pers := '"dbPM".tbTask'
- -- , _delete_system_data := true
- -- ,_init_data := true, _init_data_uid := 1 ,_init_data_acc := null
- -- ,_fnCheckPost := <fn> -- Field to check cannot be changed when refered by posting data source
- );
- */
- select * from "dbSys".tvCreateView ( varint('userid_admin_cloudora'), varint('accid_cloudora'), '"dbUserAccReg".tbTask'
- ,CheckUserAcc:=true
- ,dropit:=true
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement