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

  1. /* rexx */
  2. signal on syntax  name error
  3. signal on halt    name error
  4. signal on failure name error
  5. '@echo off'
  6.  
  7. 'cls'
  8. say
  9. say 'G2Hi --- Testing REXXGDB2.DLL HTML image tag creator function'
  10. say '         (G2HSelect2Img)'
  11. say 'Simon Husin (husin@ibm.net)'
  12. say 'Kent, Washington, U.S.A., Nov 1996 - Aug 1997'
  13. say
  14.  
  15. sq5 = "SELECT picture from emp_photo where empno = '000130' and translate(photo_format) = 'GIF'"
  16. sq6 = "Select firstnme||' '||midinit||' '||lastname from employee where empno = '000130'"
  17. sq7 = "SELECT picture from emp_photo where empno = '000140' and translate(photo_format) = 'GIF'"
  18. sq8 = "Select firstnme||' '||midinit||' '||lastname from employee where empno = '000140'"
  19.  
  20. htmlfn = 'G22HTML.HTM'
  21. requestedrows = 9999999
  22. nullchar      = ''
  23. varcharlen    = ''
  24. show_border   = '1'
  25. show_rownum   = '1'
  26. show_header   = '1'
  27.  
  28. if rxfuncquery('g2LoadFuncs') then do
  29.    say
  30.    say 'Loading REXXGDB2 Functions...'
  31.    call rxfuncadd 'g2LoadFuncs', 'REXXGDB2', 'g2LoadFuncs'
  32.    say 'Result =' g2LoadFuncs()
  33.    end
  34.  
  35. say
  36. say 'Connecting to SAMPLE database...'
  37. say 'SQLCODE='g2connectshare('SAMPLE')
  38.  
  39. say
  40. '@del' htmlfn '1>NUL 2>NUL'
  41.  
  42. call time 'R'
  43. call          g2h           htmlfn, 1, '<FORM METHOD="POST">'
  44. call          g2h           htmlfn, 1, '<CENTER><TABLE BORDER=10><TR><TD>'
  45. call          g2hselect2img htmlfn,  , 'sq5', 'PHOTO5.GIF'
  46. call          g2h           htmlfn, 1, '</TD></TR></TABLE></CENTER>'
  47. call          g2h           htmlfn, 1, '<HR><P>'
  48.  
  49. call          g2h           htmlfn, 1, '<TABLE BORDER><TR><TD>'
  50. call          g2hselect2img htmlfn,  , 'sq5', 'PHOTO5.GIF'
  51. call          g2h           htmlfn, 1, '</TD></TR></TABLE>'
  52. call          g2h           htmlfn, 1, '<HR>'
  53.  
  54. call          g2hselect2img htmlfn, 1, 'sq5', 'PHOTO5.GIF'
  55. call          g2h           htmlfn, 1, '<HR>'
  56.  
  57. call          g2h           htmlfn, 1, '<CENTER><TABLE BORDER=5><TR><TD>'
  58. call          g2hselect2img htmlfn,  , 'sq7', 'PHOTO7.GIF', 'Photo1'
  59. call          g2h           htmlfn, 1, '</TD></TR></TABLE></CENTER>'
  60. call          g2h           htmlfn, 1, '<HR><P>'
  61.  
  62. call          g2hselect2img htmlfn, 1, 'sq7', 'PHOTO7.GIF', 'Photo2'
  63. call          g2h           htmlfn, 1, '<HR>'
  64.  
  65. call          g2hselect2img htmlfn, 1, 'sq7', 'PHOTO7.GIF', 'Photo3', 'm'
  66. call          g2h           htmlfn, 1, g2selectone('sq8')
  67. call          g2h           htmlfn, 1, '<BR></FORM>'
  68. elapse = time('E')
  69.  
  70. '@netscape file:///'htmlfn
  71. /* '@explore -q' htmlfn */
  72.  
  73. say 'Execution time' elapse
  74.  
  75. say
  76. say 'Commiting...'
  77. call g2commit
  78. return 0
  79.  
  80.  
  81.  
  82. error:
  83. say 'Error detected at line' SIGL
  84. return 10
  85.  
  86. syntax:
  87. say 'Syntax error detected at line' SIGL
  88. return 20
  89.