====== pears.iqacCreateNominal ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."iqacCreateNominal"(
/* Application Maintained Function / Procedure - DO NOT EDIT*/
in "pNominalCode" char(12),in "pNominalType" char(1),in "pName" char(50),in "pNominalGroup" char(12),in "pLedgerRelationship" char(30),in "pLedgerID" char(12),in "pAccountCode" char(12),out "oResult" char(250) )
begin
if("isnull"("pNominalCode",'') = '') then
set "oResult" = '99:~Missing input';
return
end if;
if exists(select "NominalCode" from "iqacnominal" where "NominalCode" = "pNominalCode") then
-- dont care about ledger
set "oResult" = '0:~Already exists';
return
end if;
insert into "iqacnominal"( "NominalCode","NominalType","Name","NominalGroup","LedgerRelationship","LedgerID","AccountCode" ) values( "pNominalCode","pNominalType","pName","pNominalGroup","pLedgerRelationship","pLedgerID","pAccountCode" ) ;
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"."iqacCreateNominal" IS
{create procedure iqacCreateNominal
/* Application Maintained Function / Procedure - DO NOT EDIT*/
(in pNominalCode char(12),in pNominalType char(1),in pName char(50),in pNominalGroup char(12),in pLedgerRelationship char(30),in pLedgerID char(12),in pAccountCode char(12),out oResult char(250))
begin
if(isnull(pNominalCode,'') = '') then
set oResult='99:~Missing input';
return
end if;
if exists(select NominalCode from iqacnominal where NominalCode = pNominalCode) then
-- dont care about ledger
set oResult='0:~Already exists';
return
end if;
insert into iqacnominal( NominalCode,NominalType,Name,NominalGroup,LedgerRelationship,LedgerID,AccountCode) values( pNominalCode,pNominalType,pName,pNominalGroup,pLedgerRelationship,pLedgerID,pAccountCode) ;
if @@rowcount = 0 then
set oResult='1:~Insert failed';
return
end if;
set oResult='0:~Success'
exception
when others then
resignal
end
}