]> granicus.if.org Git - postgresql/commitdiff
Add -cmdTuples to tcl interface.
authorBruce Momjian <bruce@momjian.us>
Tue, 26 Nov 2002 21:38:49 +0000 (21:38 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 26 Nov 2002 21:38:49 +0000 (21:38 +0000)
doc/src/sgml/libpgtcl.sgml
src/interfaces/libpgtcl/pgtclCmds.c

index e5af787d9ad419e8b5f506e7e5bcd32f8a7350ed..7c216dd67330ea2024c178d0e449809fe970fb81 100644 (file)
@@ -728,6 +728,16 @@ the number of tuples returned by the query.
 </VARLISTENTRY>
 <VARLISTENTRY>
 <TERM>
+<option>-cmdTuples</option>
+</TERM>
+<LISTITEM>
+<PARA>
+the number of tuples affected by the query.
+</PARA>
+</LISTITEM>
+</VARLISTENTRY>
+<VARLISTENTRY>
+<TERM>
 <option>-numAttrs</option>
 </TERM>
 <LISTITEM>
index ef11cca2d403636d59259deb3d0781dac13dae63..ff57d2c365367fb13786bb38e401a2d96d5cba2a 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.69 2002/10/17 14:51:50 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.70 2002/11/26 21:38:49 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -506,6 +506,8 @@ Pg_exec(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
 
        -numTuples      the number of tuples in the query
 
+       -cmdTuples      the number of tuples affected by the query
+
        -numAttrs       returns the number of attributes returned by the query
 
        -assign arrayName
@@ -591,6 +593,11 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
                sprintf(interp->result, "%d", PQntuples(result));
                return TCL_OK;
        }
+       else if (strcmp(opt, "-cmdTuples") == 0)
+       {
+               sprintf(interp->result, "%s", PQcmdTuples(result));
+               return TCL_OK;
+       }
        else if (strcmp(opt, "-numAttrs") == 0)
        {
                sprintf(interp->result, "%d", PQnfields(result));
@@ -768,6 +775,7 @@ Pg_result_errReturn:
                                         "\t-conn\n",
                                         "\t-oid\n",
                                         "\t-numTuples\n",
+                                        "\t-cmdTuples\n",
                                         "\t-numAttrs\n"
                                         "\t-assign arrayVarName\n",
                                         "\t-assignbyidx arrayVarName ?appendstr?\n",