home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxgdb2.zip / G2BLOB.CMD < prev    next >
OS/2 REXX Batch file  |  1997-08-10  |  2KB  |  63 lines

  1. /* rexx */
  2. signal on error
  3. signal on syntax  name error
  4. signal on halt    name error
  5. signal on failure name error
  6. '@echo off'
  7.  
  8. 'cls'
  9. say
  10. say 'G2BLOB --- Testing REXXGDB2.DLL BLOB function(s)'
  11. say 'Simon Husin (husin@ibm.net)'
  12. say 'Kent, Washington, U.S.A., November 1996'
  13. say
  14.  
  15. sq5 = "SELECT picture from emp_photo where empno = '000130' and translate(photo_format) = 'GIF'"
  16.  
  17. if rxfuncquery('g2LoadFuncs') then do
  18.    say
  19.    say 'Loading REXXGDB2 Functions...'
  20.    call rxfuncadd 'g2LoadFuncs', 'REXXGDB2', 'g2LoadFuncs'
  21.    say 'Result =' g2LoadFuncs()
  22.    end
  23.  
  24. say
  25. say 'Connecting to SAMPLE database...'
  26. call g2connectshare 'SAMPLE'
  27.  
  28. say
  29. say  'SQ5='sq5
  30. say
  31.  
  32. call time 'R'
  33. say  'G2SELECTBLOB RESULT 1 (SQ5 Value)='g2selectblob(sq5,   'PHOTO1.GIF')
  34. say  '---elapse   ='time('R')
  35. say
  36. say  'G2SELECTBLOB RESULT 2 (SQ5)......='g2selectblob('sq5', 'PHOTO2.GIF')
  37. say  '---elapse   ='time('R')
  38. say
  39. say  'G2SELECTBLOB RESULT 3 (value)....='g2selectblob("SELECT picture from emp_photo where empno = '000130' and translate(photo_format) = 'GIF'", 'PHOTO3.GIF')
  40. say  '---elapse   ='time('R')
  41. say
  42. say  'Retrieving (using SQ5 Value) 100 times...'
  43. do 100
  44.    call g2selectblob sq5, 'PHOTO4.GIF'
  45.    end
  46. elapse = time('R')
  47. say  '---elapse   ='elapse '(total),  'elapse / 100 '(per call on average)'
  48.  
  49. say
  50. say 'Commiting...'
  51. call g2commit
  52. return 0
  53.  
  54.  
  55.  
  56. error:
  57. say 'Error detected at line' SIGL
  58. return 10
  59.  
  60. syntax:
  61. say 'Syntax error detected at line' SIGL
  62. return 20
  63.