f_get_outerconnection.srf 797 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. $PBExportHeader$f_get_outerconnection.srf
  2. global type f_get_outerconnection from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_get_outerconnection (ref long arg_connectionid, ref string arg_msg)
  6. end prototypes
  7. global function integer f_get_outerconnection (ref long arg_connectionid, ref string arg_msg);Int rslt = 1
  8. Long cnt = 0
  9. SELECT count(*) INTO :cnt
  10. FROM u_outerconnection
  11. Where ConnectionType = 0;
  12. IF sqlca.SQLCode <> 0 THEN
  13. rslt = 2
  14. GOTO ext
  15. END IF
  16. IF cnt = 0 THEN
  17. rslt = 2
  18. GOTO ext
  19. END IF
  20. SELECT top 1 connectionid
  21. INTO :arg_connectionid
  22. FROM u_outerconnection
  23. Where ConnectionType = 0;
  24. IF sqlca.SQLCode <> 0 THEN
  25. arg_msg = '查询附件数据库资料失败,'+sqlca.SQLErrText
  26. rslt = 0
  27. GOTO ext
  28. END IF
  29. ext:
  30. RETURN rslt
  31. end function