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
f30d39e7
Commit
f30d39e7
authored
Jan 26, 2004
by
Neil Conway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage examples for PREPARE and EXECUTE. Original patch from Gavin
Sherry, editorializing by Neil Conway.
parent
146aab49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
doc/src/sgml/ref/execute.sgml
doc/src/sgml/ref/execute.sgml
+10
-1
doc/src/sgml/ref/prepare.sgml
doc/src/sgml/ref/prepare.sgml
+24
-1
No files found.
doc/src/sgml/ref/execute.sgml
View file @
f30d39e7
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/execute.sgml,v 1.
7 2003/11/29 19:51:38 pgsql
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/execute.sgml,v 1.
8 2004/01/26 17:26:30 neilc
Exp $
PostgreSQL documentation
-->
...
...
@@ -78,6 +78,15 @@ EXECUTE <replaceable class="PARAMETER">plan_name</replaceable> [ (<replaceable c
</variablelist>
</refsect1>
<refsect1>
<title>Examples</>
<para>
Examples are given in the <xref linkend="sql-prepare-examples"
endterm="sql-prepare-examples-title"> section of the <xref
linkend="sql-prepare" endterm="sql-prepare-title"> documentation.
</para>
</refsect1>
<refsect1>
<title>Compatibility</title>
...
...
doc/src/sgml/ref/prepare.sgml
View file @
f30d39e7
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/prepare.sgml,v 1.1
0 2003/12/14 00:55:46
neilc Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/prepare.sgml,v 1.1
1 2004/01/26 17:26:31
neilc Exp $
PostgreSQL documentation
-->
...
...
@@ -139,6 +139,29 @@ PREPARE <replaceable class="PARAMETER">plan_name</replaceable> [ (<replaceable c
</para>
</refsect1>
<refsect1 id="sql-prepare-examples">
<title id="sql-prepare-examples-title">Examples</title>
<para>
Create a prepared query for an <command>INSERT</command> statement,
and then execute it:
<programlisting>
PREPARE fooplan (int, text, bool, numeric(8,2)) AS
INSERT INTO foo VALUES($1, '$2', '$3', '$4');
EXECUTE fooplan(1, 'Hunter Valley', 't', '200.00');
</programlisting>
</para>
<para>
Create a prepared query for a <command>SELECT</command> statement,
and then execute it:
<programlisting>
PREPARE usrrptplan (int, date) AS
SELECT * FROM users u, logs l WHERE u.usrid=$1 AND u.usrid=l.usrid
AND l.date = $2;
EXECUTE usrrptplan(1, current_date);
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Compatibility</title>
...
...
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