*
* Use 'copy_host --help' for usage.
*
- * $Id: copy_host.ml,v 1.1 2006/09/09 15:08:08 rich Exp $
+ * $Id: copy_host.ml,v 1.2 2006/09/11 09:58:43 rich Exp $
*)
open Printf
(* Get column names from a table. *)
let columns dbh table_name =
- let query = "select * from " ^ table_name in
+ let query = "select * from " ^ table_name ^ " order by 1" in
let name = "columns" in
PGOCaml.prepare dbh ~query ~name ();
let columns =
let query = "select * from " ^ table_name ^
(match where_clause with
| "" -> ""
- | where_clause -> " where " ^ where_clause) in
+ | where_clause -> " where " ^ where_clause) ^
+ " order by 1" in
let name = "selectall" in
PGOCaml.prepare dbh ~query ~name ();
let columns =