f_find_dftstorageid.srf 613 B

12345678910111213141516171819202122232425262728293031
  1. $PBExportHeader$f_find_dftstorageid.srf
  2. global type f_find_dftstorageid from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_find_dftstorageid (long arg_mtrlid, ref long arg_storageid)
  6. end prototypes
  7. global function integer f_find_dftstorageid (long arg_mtrlid, ref long arg_storageid);Int rslt = 1
  8. IF arg_mtrlid = 0 THEN
  9. arg_storageid = 0
  10. RETURN 1
  11. END IF
  12. SELECT top 1 storageid
  13. INTO :arg_storageid
  14. FROM u_mtrl_storage
  15. Where mtrlid = :arg_mtrlid;
  16. IF sqlca.SQLCode <> 0 THEN
  17. arg_storageid = 0
  18. END IF
  19. if isnull(arg_storageid) then arg_storageid = 0
  20. RETURN rslt
  21. end function