EXECUTE PROCEDURE TOWN_I (‘TownA’);
if TownA is in the db the returnvalue will be 999 else it will be 998.
The above test is done in flamerobin.
CREATE PROCEDURE TOWN_I (
TOWN_NAME Varchar(100)
)
RETURNS (
RETURNVALUE Integer
)
AS
DECLARE VARIABLE checkValue INT;
BEGIN
checkValue = (SELECT COUNT(TOWN_NAME)
FROM TBLTOWNS
WHERE Description = :DESCRIPTION);
IF (checkValue > 0) then
RETURNVALUE = 999;
ELSE
RETURNVALUE = 998;
END^
keep in mind: The code is case sensitive! (TOWN_NAME is not town_name)
RETURNS are the value(s) that are marked OUTPUT in MS-Sql server.
Fine ideas! I have been hunting for everything such as this for some time these days. Thanks!