summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2002-11-26 21:38:49 +0000
committerBruce Momjian2002-11-26 21:38:49 +0000
commit299a4acb8b7c2ea6ba032137ab956ba675dc844a (patch)
treed4a3110594eb578131675a66b74783aad0ac5cfa
parent9c8bc3324d5c570675390bbe6e9eb4f4c418b8b7 (diff)
Add -cmdTuples to tcl interface.
-rw-r--r--doc/src/sgml/libpgtcl.sgml10
-rw-r--r--src/interfaces/libpgtcl/pgtclCmds.c8
2 files changed, 18 insertions, 0 deletions
diff --git a/doc/src/sgml/libpgtcl.sgml b/doc/src/sgml/libpgtcl.sgml
index e5af787d9a..7c216dd673 100644
--- a/doc/src/sgml/libpgtcl.sgml
+++ b/doc/src/sgml/libpgtcl.sgml
@@ -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>
diff --git a/src/interfaces/libpgtcl/pgtclCmds.c b/src/interfaces/libpgtcl/pgtclCmds.c
index 0baff9e385..69d9267309 100644
--- a/src/interfaces/libpgtcl/pgtclCmds.c
+++ b/src/interfaces/libpgtcl/pgtclCmds.c
@@ -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",