12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- $PBExportHeader$f_check_status.srf
- global type f_check_status from function_object
- end type
- forward prototypes
- global function integer f_check_status (integer arg_type, string arg_string)
- end prototypes
- global function integer f_check_status (integer arg_type, string arg_string);Int rslt = 1
- Long cnt = 0
- IF sys_option_aloweditstatus = 0 THEN
- rslt = 1
- GOTO ext
- END IF
- IF arg_string = '' THEN
- rslt = 1
- GOTO ext
- END IF
- IF arg_type = 1 THEN
- SELECT count(*) INTO :cnt
- FROM u_color
- Where colorname = :arg_string;
- ELSEIF arg_type = 2 THEN
- SELECT count(*) INTO :cnt
- FROM u_color_wood
- Where woodcode = :arg_string;
- ELSEIF arg_type = 3 THEN
- SELECT count(*) INTO :cnt
- FROM u_color_pcode
- Where pcode = :arg_string;
- END IF
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF cnt <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- ext:
- RETURN rslt
- end function
|