This function should be added since it's very usefull to get the output of a
SQL statement.
* * *
func (c *Conn) QueryOutput(statement string) (a []string, err os.Error) {
query, err := c.Prepare(statement)
if err != nil {
return
}
defer query.Finalize()
if err = query.Exec(); err != nil {
return
}
var field string
for {
if ok := query.Next(); !ok {
break
}
if err = query.Scan(&field); err != nil {
return nil, err
}
a = append(a, field)
}
return
}
* * *
Original issue reported on code.google.com by raul....@sent.com on 1 Dec 2010 at 12:06
Original issue reported on code.google.com by
raul....@sent.com
on 1 Dec 2010 at 12:06