# |>Description.<|
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands.  Sourcing this file into Tcl runs the tests and
# generates output for errors.  No output means no errors were found.
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id: orafetchall.test,v 1.4 1999/10/12 02:01:23 mtariq Exp $

# more exhaustive test than what is in basic_tests.test
# tests internal function orafetch-all


source [file  join [pwd] [file dirname [info script]] defs.tcl]

test orafetchtest {test oratcl cmd orafetch} {
    set handle [oralogon $oracleuser/$oraclepw@$connstring]
    set cursor [oraopen $handle]
    orasql $cursor "select ename from emp order by ename"
    set num_rows 0
    orafetch $cursor {
      incr num_rows
      if {[string compare @1 M] == 1} {
         # employee name greater than "L", break out of orafetch
         break
      }
      if {$num_rows > 5} {
         # more than five rows in query, don't print anymore
         continue
      }
     
      set name @0
  }
  oralogoff $handle
  set result $name   
  } {FORD}

::tcltest::cleanupTests
return 
