====== pears.NetOwnerSetCompanySalesStatus ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetOwnerSetCompanySalesStatus"( in "pWebUserID" char(20),in "pCompanyID" char(20),in "pNewCompanySalesStatus" char(1) )
result( "pResult" char(255) )
begin
declare "SalesStatusNotDefined" exception for sqlstate value '23503';
update "Company" set "SalesStatus" = "pNewCompanySalesStatus" where "CompanyID" = "pCompanyID";
if @@rowcount <> 1 then
select '2:~CompanyID not found'
else
select '0:~success'
end if
exception
when "SalesStatusNotDefined" then select '3:~Sales Status Not Defined'
when others then
select '1~:SalesStatus not set'
end /* DOC
2020-06-01 GJ IW-1188 Created/Modified proc from Justin so it works on the web
*/
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetOwnerSetCompanySalesStatus" IS
{create PROCEDURE pears."NetOwnerSetCompanySalesStatus"(in pWebUserID char(20), IN pCompanyID char(20), IN pNewCompanySalesStatus char(1))
result (pResult char(255))
BEGIN
DECLARE SalesStatusNotDefined EXCEPTION FOR SQLSTATE '23503';
UPDATE Company SET SalesStatus = pNewCompanySalesStatus WHERE CompanyID = pCompanyID;
IF @@rowcount <> 1 THEN
SELECT '2:~CompanyID not found';
ELSE
SELECT '0:~success';
END IF;
EXCEPTION WHEN SalesStatusNotDefined THEN
SELECT '3:~Sales Status Not Defined';
WHEN OTHERS THEN
SELECT'1~:SalesStatus not set';
END
/* DOC
2020-06-01 GJ IW-1188 Created/Modified proc from Justin so it works on the web
*/
}