- 18


AS

BEGIN

ACode = GEN_ID(genUslCatKeys, 1);

END ^

CREATE PROCEDURE PrGenUslCat

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genUslCat, 1);

END ^

CREATE PROCEDURE PrGenPhones

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genPhones, 1);

END ^

CREATE PROCEDURE PrGenPhonesOwnersKeys

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genPhonesOwnersKeys, 1);

END ^

CREATE PROCEDURE PrGenPhonesOwners

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genPhonesOwners, 1);

END ^

CREATE PROCEDURE PrGenSysSettings

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genSysSettings, 1);

END ^

CREATE PROCEDURE PrGenPhonesKeys

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genPhonesKeys, 1);

END ^

CREATE PROCEDURE PrGenPlat

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genPlat, 1);

END ^

CREATE PROCEDURE PrGenPhonesPostStations

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genPhonesPostStations, 1);

END ^

CREATE PROCEDURE PrGenSysLog

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genSysLog, 1);

END ^

CREATE PROCEDURE PrGenUslTypes

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genUslTypes, 1);

END ^

CREATE PROCEDURE PrGenUslDivisionsKeys

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genUslDivisionsKeys, 1);

END ^

^

CREATE PROCEDURE TalksExamineOwner (APhoneNmb CHAR(7), ADate DATE)

RETURNS (APhone INTEGER)

AS

DECLARE VARIABLE AStreet INTEGER;

DECLARE VARIABLE NOwner INTEGER;

DECLARE VARIABLE APhoneCode INTEGER;

BEGIN

SELECT PKey FROM Phones WHERE (PhoneNmb = :APhoneNmb) AND (:ADate BETWEEN BegDate AND EndDate)

INTO :APhone;

IF (:APhone IS NULL) THEN

BEGIN

SELECT NullOwner FROM SysSettings INTO :NOwner;