Anonymous     Text only     13 Oct 2008    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FUNCTION TranslateNumDep(xlpu_id, s_p_c, xdep_cod)
DEFINE xlpu_id INTEGER
,s_p_c SMALLINT
,xdep_cod INTEGER
,lp_id
,prof_cod
,dp_id INTEGER
,tmp_str CHAR(100)
INITIALIZE dp_id TO NULL
LET prof_cod = 0
LET lp_id = xlpu_id
IF (xlpu_id > 0) AND (xdep_cod > 0) THEN
SELECT med_id, mprofil_cod, sublpu_id
INTO dp_id, prof_cod, lp_id
FROM r_numdep
WHERE lpu_id = xlpu_id
AND dep_cod = xdep_cod
AND s_p_cod = s_p_c
IF STATUS = NOTFOUND THEN
LET tmp_str = "Отделение с кодом ", xdep_cod, " в таблице перекодировки не обнаружено."
LET dp_id = 0
LET prof_cod = 0
LET lp_id = 0
ERROR tmp_str
CALL ERRORLOG(tmp_str)
END IF
END IF
RETURN dp_id, prof_cod, lp_id
END FUNCTION