====== pears.iqacCreateAccount ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."iqacCreateAccount"(
/* Application Maintained Function / Procedure - DO NOT EDIT*/
in "pLedgerID" char(12),in "pAccountCode" char(12),in "pName" char(50),out "oResult" char(250) )
begin
if("isnull"("pledgerid",'') = '') or("isnull"("paccountcode",'') = '') or("isnull"("pname",'') = '') then
set "oresult" = '99:~Missing input';
return
end if;
if exists(select "ledgerid","accountcode" from "iqacaccount" where "ledgerid" = "pledgerid" and "accountcode" = "paccountcode") then
set "oresult" = '0:~Already exists';
return
end if;
insert into "iqacaccount"( "AccountCode","LedgerID","Name" ) values( "paccountcode","pLedgerID","pname" ) ;
if @@rowcount = 0 then
set "oresult" = '1:~Insert failed';
return
end if;
set "oresult" = '0:~Success'
exception
when others then
resignal
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."iqacCreateAccount" IS
{create procedure iqacCreateAccount
/* Application Maintained Function / Procedure - DO NOT EDIT*/
(in pLedgerID char(12),in pAccountCode char(12),in pName char(50),out oResult char(250))
begin
if(isnull(pledgerid,'') = '') or(isnull(paccountcode,'') = '') or(isnull(pname,'') = '') then
set oresult='99:~Missing input';
return
end if;
if exists(select ledgerid,accountcode from iqacaccount where ledgerid = pledgerid and accountcode = paccountcode) then
set oresult='0:~Already exists';
return
end if;
insert into iqacaccount( AccountCode,LedgerID,Name) values( paccountcode,pLedgerID,pname) ;
if @@rowcount = 0 then
set oresult='1:~Insert failed';
return
end if;
set oresult='0:~Success'
exception
when others then
resignal
end
}