[libgda/LIBGDA_5.0] GdaSql: allow to bind only 1 object



commit 0b4a05e97bb40209e502e931f0e6b989c3206a0e
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Mar 1 20:52:22 2012 +0100

    GdaSql: allow to bind only 1 object
    
    this is useful when one only wants to consult a dataset
    using SQL commands

 tools/gda-sql.c               |   10 +++++-----
 tools/help/C/gda-sql-help.xml |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/tools/gda-sql.c b/tools/gda-sql.c
index 63d5991..fc01917 100644
--- a/tools/gda-sql.c
+++ b/tools/gda-sql.c
@@ -2437,10 +2437,10 @@ build_internal_commands_list (void)
 	c = g_new0 (GdaInternalCommand, 1);
 	c->group = _("General");
 	c->group_id = NULL;
-	c->name = g_strdup_printf (_("%s <CNC NAME> <OBJ NAME1> <OBJ NAME2> [<OBJ NAME> ...]"), "bind");
-	c->description = _("Bind two or more connections or datasets (<OBJ NAME>) into a single new one (allowing SQL commands to be executed across multiple connections and datasets)");
+	c->name = g_strdup_printf (_("%s <CNC NAME> <OBJ NAME> [<OBJ NAME> ...]"), "bind");
+	c->description = _("Bind connections or datasets (<OBJ NAME>) into a single new one (allowing SQL commands to be executed across multiple connections and/or datasets)");
 	c->args = NULL;
-	c->command_func = (GdaInternalCommandFunc)extra_command_bind_cnc;
+	c->command_func = (GdaInternalCommandFunc) extra_command_bind_cnc;
 	c->user_data = NULL;
 	c->arguments_delimiter_func = NULL;
 	c->unquote_args = TRUE;
@@ -3603,7 +3603,7 @@ extra_command_bind_cnc (SqlConsole *console, G_GNUC_UNUSED GdaConnection *cnc, c
 	GdaConnection *virtual;
 	GString *string;
 
-	if (nargs < 3) {
+	if (nargs < 2) {
 		g_set_error (error, 0, 0, "%s", 
 				     _("Missing required connection names"));
 		return NULL;
@@ -4768,7 +4768,7 @@ extra_command_data_set_show (G_GNUC_UNUSED SqlConsole *console, GdaConnection *c
 		gint i;
 		cols = g_array_new (FALSE, FALSE, sizeof (gint));
 		for (i = 1; args[i] && *args[i]; i++) {
-			gchar *cname = args[i];
+			const gchar *cname = args[i];
 			gint pos;
 			pos = gda_data_model_get_column_index (src, cname);
 			if (pos < 0) {
diff --git a/tools/help/C/gda-sql-help.xml b/tools/help/C/gda-sql-help.xml
index 44327b2..3f10605 100644
--- a/tools/help/C/gda-sql-help.xml
+++ b/tools/help/C/gda-sql-help.xml
@@ -16,10 +16,10 @@
 
   <!-- ".bind" command -->
   <command name="bind">
-    <shortdescription>Bind two or more connections or datasets into a single new one (allowing SQL commands to be executed across multiple connections and datasets).
+    <shortdescription>Bind connections or datasets into a single new one (allowing SQL commands to be executed across multiple connections and/or datasets).
     </shortdescription>
     <usage>
-      <synopsis>.bind @CNC NAME@ @OBJ NAME1@ @OBJ NAME2@ [ OBJ NAME@ ...]</synopsis>
+      <synopsis>.bind @CNC NAME@ @OBJ NAME@ [ OBJ NAME@ ...]</synopsis>
       <comment>creates a new connection named @CNC_NAME@, which binds data from each of the named object
       (@OBJ NAME@). If a named object is a connection, then all the tables in the named connection
       are bound (in a schema named after the connection name) and if a named object is a dataset,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]