home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxgdb2.zip / G2Form.CMD < prev    next >
OS/2 REXX Batch file  |  1997-08-10  |  2KB  |  72 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 'G2Form --- Testing REXXGDB2.DLL function: G2SelectForm'
  11. say 'Simon Husin (husin@ibm.net)'
  12. say 'Kent, Washington, U.S.A., December 1995, November 1996'
  13. say
  14.  
  15. sql = 'Select * from org'
  16. stem = 'form.'
  17. requestedrows = 999999999
  18. nullchar      = '%'
  19. padchar       = '_'
  20. varcharlen    = 10
  21.  
  22. say 'SQL:         'sql
  23. say 'Stem:        'stem
  24. say 'Req. rows:   'requestedrows
  25. say 'Null Char.:  'nullchar
  26. say 'Pad Char.:   'padchar
  27. say 'VARCHAR len.:'varcharlen
  28.  
  29. if rxfuncquery('g2LoadFuncs') then do
  30.    say
  31.    say 'Loading REXXGDB2 Functions...'
  32.    call rxfuncadd 'g2LoadFuncs', 'REXXGDB2', 'g2LoadFuncs'
  33.    say 'Result =' g2LoadFuncs()
  34.    end
  35.  
  36. say
  37. call time 'R'
  38. say 'Connecting to SAMPLE database...'
  39. call g2connectshare 'SAMPLE'
  40. say 'Execution time    ' time('E')
  41.  
  42. say
  43. call time 'R'
  44. retcode = g2selectform(sql, stem, requestedrows, nullchar, padchar, varcharlen)
  45. elapse = time('E')
  46. say 'Return Code       ' retcode
  47. say 'Execution time    ' time('E')
  48. say
  49. say 'Stem tot# elements' form.0
  50. if retcode = 0 | retcode = 100 then do
  51.    say 'Element FORM.0.0=' form.0.0
  52.    do i = 1 to form.0
  53.       say 'Element FORM.'i ' =' form.i
  54.       end
  55.  
  56. say
  57. call time 'R'
  58. say 'Commiting...'
  59. call g2commit
  60. say 'Execution time    ' time('E')
  61. return 0
  62.  
  63.  
  64.  
  65. error:
  66. say 'Error detected at line' SIGL
  67. return 10
  68.  
  69. syntax:
  70. say 'Syntax error detected at line' SIGL
  71. return 20
  72.