Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.iqacSelfBillCreate ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create procedure "pears"."iqacSelfBillCreate"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "pSessionID" char(20),in "pDocDate" date ) result( "pResult" char(250),"pinvcount" integer ) begin declare "res" integer; declare "invcount" integer; declare "acc" char(12); set "invcount" = 0; -- rewrite as loop select first "accountcode" into "acc" from "InvoiceValidReportData" where "sessionid" = "psessionid" and "processed" = 0 order by "sortorder" asc; while "acc" is not null loop call "iqacSelfBillOneAccount"("acc","psessionid","pdocdate","invcount"); -- update InvoiceValidReportData set processed = 1 where accountcode = acc; -- above done for each timesheet set "acc" = null; select first "accountcode" into "acc" from "InvoiceValidReportData" where "sessionid" = "psessionid" and "processed" = 0 order by "sortorder" asc end loop; select '0:~Success',"invcount" exception when others then resignal; select '1:~Failed',"invcount" end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."iqacSelfBillCreate" IS {create procedure iqacSelfBillCreate /* Application Maintained Function / Procedure - DO NOT EDIT*/ ( in pSessionID char(20),in pDocDate date ) result( pResult char(250),pinvcount integer ) begin declare res integer; declare invcount integer; declare acc char(12); set invcount = 0; -- rewrite as loop select first accountcode into acc from InvoiceValidReportData where sessionid = psessionid and processed = 0 order by sortorder asc; while acc is not null loop call iqacSelfBillOneAccount(acc,psessionid,pdocdate,invcount); -- update InvoiceValidReportData set processed = 1 where accountcode = acc; -- above done for each timesheet set acc = null; select first accountcode into acc from InvoiceValidReportData where sessionid = psessionid and processed = 0 order by sortorder asc end loop; select '0:~Success',invcount exception when others then resignal; select '1:~Failed',invcount end } </code> database/procedures/pears_iqacselfbillcreate.txt Last modified: 2026/08/07 19:24by 127.0.0.1