You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by ka...@apache.org on 2004/06/03 22:53:43 UTC

cvs commit: tcl-rivet/rivet/packages/dio dio.tcl

karl        2004/06/03 13:53:43

  Modified:    rivet/packages/dio dio.tcl
  Log:
  Add the -select option to let the user select what fields are being returned,
  rather than always being *.
  
  Revision  Changes    Path
  1.9       +8 -1      tcl-rivet/rivet/packages/dio/dio.tcl
  
  Index: dio.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/rivet/packages/dio/dio.tcl,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- dio.tcl	5 May 2004 00:24:02 -0000	1.8
  +++ dio.tcl	3 Jun 2004 20:53:43 -0000	1.9
  @@ -59,6 +59,7 @@
   	set first 1
   	set req ""
   	set myTable $table
  +	set what "*"
   	for {set i 0} {$i < [llength $args]} {incr i} {
   	    set elem [lindex $args $i]
   
  @@ -68,6 +69,10 @@
   
   		"-table" { set myTable [lindex $args [incr i]] }
   
  +		"-select" {
  +		    set what [lindex $args [incr i]]
  +		}
  +
   		default {
   		    if {[::string index $elem 0] == "-"} {
   			set field [::string range $elem 1 end]
  @@ -92,7 +97,9 @@
   		}
   	    }
   	}
  -	return "select * from $myTable $req"
  +	return "select $what from $myTable $req"
  +
  +	return "select $what from $myTable $req"
       }
   
       protected method build_insert_query {arrayName fields {myTable ""}} {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org