;-*-Mode: text;-*- -[Tue Jul 19 23:12:50 1994 by cxh]-

- SQLfetchCursor does not work if one fetches from two different
cursors one after another.  The work around is to do an
SQLprepareCursor and SQLdescribeCursor between fetches to different cursors.

# This code fails
proc test_mult_curs {} {
  echo "	Test out fetching from two cursors concurrently.";
  opendb;

  # Get the first header.
  SQLdeclareCursor curs;
  SQLdeclareCursor curs2;
  SQLprepareCursor curs "select * from tables";
  SQLdescribeCursor curs header 0;
  pheader header
  set rowlen [array size header];

  # Get the second header.
  SQLprepareCursor curs2 "select * from columns";
  SQLdescribeCursor curs2 header2 0;
  pheader header2;
  set rowlen2 [array size header2];
  SQLopenCursor -readonly curs;

  # Fetch from the first cursor
  for {set i 0} {1} {set i [expr $i+1]} {
    SQLfetchCursor curs row $i;
    if {[SQLmoreRows]} {
      prow row $i $rowlen;
    } else {
      break;
    }
  }
  #fetch_curs;
  #fetch_curs2;
}


-------
tclsql should follow John Ousterhout's tcl extension  recommendations.
-------
tclsql clutters the name space with lots of new names.
-------
tclsql only works with Ingres.  sybtcl and oratcl work with Sybase and
Oracle.  See ftp://harbor.ecn.purdue.edu/pub/tcl for more information.
