Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
83c9ec76
Commit
83c9ec76
authored
Jul 23, 1996
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Last changes to src from Dr. George *wipes brow*
parent
2206b581
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
src/interfaces/libpgtcl/Makefile
src/interfaces/libpgtcl/Makefile
+3
-2
src/interfaces/libpgtcl/pgtclCmds.c
src/interfaces/libpgtcl/pgtclCmds.c
+26
-1
No files found.
src/interfaces/libpgtcl/Makefile
View file @
83c9ec76
...
...
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.
1.1.1 1996/07/09 06:22:16
scrappy Exp $
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.
2 1996/07/23 03:38:42
scrappy Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -20,7 +20,8 @@ CFLAGS+= -I$(HEADERDIR) \
-I
$(srcdir)
/backend/include
\
-I
$(srcdir)
/backend
\
-I
$(CURDIR)
\
-I
$(TCL_INCDIR)
-I
$(TCL_INCDIR)
\
-I
$(srcdir)
/libpq
ifdef
KRBVERS
CFLAGS
+=
$(KRBFLAGS)
...
...
src/interfaces/libpgtcl/pgtclCmds.c
View file @
83c9ec76
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.
1.1.1 1996/07/09 06:22:16
scrappy Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.
2 1996/07/23 03:38:44
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -194,6 +194,8 @@ Pg_exec(AlientData cData, Tcl_Interp *interp, int argc, char* argv[])
the connection that produced the result
-assign arrayName
assign the results to an array
-assignbyidx arrayName
assign the results to an array using the first field as a key
-numTuples
the number of tuples in the query
-attributes
...
...
@@ -211,6 +213,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char* argv[])
char
*
opt
;
int
i
;
int
tupno
;
char
prearrayInd
[
MAX_MESSAGE_LEN
];
char
arrayInd
[
MAX_MESSAGE_LEN
];
char
*
arrVar
;
...
...
@@ -268,6 +271,27 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char* argv[])
Tcl_AppendResult
(
interp
,
arrVar
,
0
);
return
TCL_OK
;
}
else
if
(
strcmp
(
opt
,
"-assignbyidx"
)
==
0
)
{
if
(
argc
!=
4
)
{
Tcl_AppendResult
(
interp
,
"-assignbyidx option must be followed by a variable name"
,
0
);
return
TCL_ERROR
;
}
arrVar
=
argv
[
3
];
/* this assignment assigns the table of result tuples into a giant
array with the name given in the argument,
the indices of the array or (tupno,attrName)*/
for
(
tupno
=
0
;
tupno
<
PQntuples
(
result
);
tupno
++
)
{
sprintf
(
prearrayInd
,
"%s"
,
PQgetvalue
(
result
,
tupno
,
0
));
for
(
i
=
1
;
i
<
PQnfields
(
result
);
i
++
)
{
sprintf
(
arrayInd
,
"%s,%s"
,
prearrayInd
,
PQfname
(
result
,
i
));
Tcl_SetVar2
(
interp
,
arrVar
,
arrayInd
,
PQgetvalue
(
result
,
tupno
,
i
),
TCL_LEAVE_ERR_MSG
);
}
}
Tcl_AppendResult
(
interp
,
arrVar
,
0
);
return
TCL_OK
;
}
else
if
(
strcmp
(
opt
,
"-getTuple"
)
==
0
)
{
if
(
argc
!=
4
)
{
Tcl_AppendResult
(
interp
,
"-getTuple option must be followed by a tuple number"
,
0
);
...
...
@@ -307,6 +331,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char* argv[])
"
\t
-status
\n
"
,
"
\t
-conn
\n
"
,
"
\t
-assign arrayVarName
\n
"
,
"
\t
-assignbyidx arrayVarName
\n
"
,
"
\t
-numTuples
\n
"
,
"
\t
-attributes
\n
"
"
\t
-getTuple tupleNumber
\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment