Реферат: Создание баз данных в InterBase SQL Server
DECLARE VARIABLE TREE_NUMBER INTEGER;
DECLARE VARIABLE TREE_OWNER INTEGER;
DECLARE VARIABLE USER_NUM INTEGER;
DECLARE VARIABLE DOC_NUM INTEGER;
DECLARE VARIABLE EDITING CHAR(1);
DECLARE VARIABLE APPENDING CHAR(1);
DECLARE VARIABLE DELETING CHAR(1);
BEGINIS_EDIT = 'F';
IS_APPEND = 'F';
IS_DELETE = 'F';
IS_SHOW = 'F';
FOR SELECT ID_NUM, ID_OWNERFROM DATA_LIST
WHERE DATA_LIST.ID_NUM = :ID_DOC
INTO TREE_NUMBER, TREE_OWNER
DO
BEGIN
IF ( TREE_NUMBER = UP_TREE ) THEN EXIT;
FOR SELECT ID_USER, ID_DOC, IS_EDIT, IS_APPEND, IS_DELETE
FROM DOCS_USERS
WHERE DOCS_USERS.ID_USER = :ID_USER
INTO USER_NUM, DOC_NUM, EDITING, APPENDING, DELETING
DO
BEGIN
IF ( TREE_NUMBER = DOC_NUM ) THEN
BEGIN
IS_EDIT = EDITING;
IS_APPEND = APPENDING;
IS_DELETE = DELETING;
IS_SHOW = 'T';