Skip to content

Commit 80e6d99

Browse files
committed
Add -cmdTuples to tcl interface.
1 parent 7fb0d91 commit 80e6d99

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

doc/src/sgml/libpgtcl.sgml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,16 @@ the number of tuples returned by the query.
728728
</VARLISTENTRY>
729729
<VARLISTENTRY>
730730
<TERM>
731+
<option>-cmdTuples</option>
732+
</TERM>
733+
<LISTITEM>
734+
<PARA>
735+
the number of tuples affected by the query.
736+
</PARA>
737+
</LISTITEM>
738+
</VARLISTENTRY>
739+
<VARLISTENTRY>
740+
<TERM>
731741
<option>-numAttrs</option>
732742
</TERM>
733743
<LISTITEM>

src/interfaces/libpgtcl/pgtclCmds.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.69 2002/10/17 14:51:50 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.70 2002/11/26 21:38:49 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -506,6 +506,8 @@ Pg_exec(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
506506
507507
-numTuples the number of tuples in the query
508508
509+
-cmdTuples the number of tuples affected by the query
510+
509511
-numAttrs returns the number of attributes returned by the query
510512
511513
-assign arrayName
@@ -591,6 +593,11 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
591593
sprintf(interp->result, "%d", PQntuples(result));
592594
return TCL_OK;
593595
}
596+
else if (strcmp(opt, "-cmdTuples") == 0)
597+
{
598+
sprintf(interp->result, "%s", PQcmdTuples(result));
599+
return TCL_OK;
600+
}
594601
else if (strcmp(opt, "-numAttrs") == 0)
595602
{
596603
sprintf(interp->result, "%d", PQnfields(result));
@@ -768,6 +775,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
768775
"\t-conn\n",
769776
"\t-oid\n",
770777
"\t-numTuples\n",
778+
"\t-cmdTuples\n",
771779
"\t-numAttrs\n"
772780
"\t-assign arrayVarName\n",
773781
"\t-assignbyidx arrayVarName ?appendstr?\n",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy