Attached is a patch adding a few examples for PREPARE/EXECUTE
Gavin
Index: doc/src/sgml/ref/execute.sgml =================================================================== RCS file: /usr/local/cvsroot/pgsql-server/doc/src/sgml/ref/execute.sgml,v retrieving revision 1.7 diff -2 -c -r1.7 execute.sgml *** doc/src/sgml/ref/execute.sgml 29 Nov 2003 19:51:38 -0000 1.7 --- doc/src/sgml/ref/execute.sgml 26 Jan 2004 07:53:10 -0000 *************** *** 80,83 **** --- 80,92 ---- <refsect1> + <title>Examples</> + <para> + Examples are given in the <xref linkend="sql-prepare-examples" + endterm="sql-prepare-examples-title"> section for + <xref linkend="sql-prepare" endterm="sql-prepare-title">. + </para> + </refsect1> + + <refsect1> <title>Compatibility</title> Index: doc/src/sgml/ref/prepare.sgml =================================================================== RCS file: /usr/local/cvsroot/pgsql-server/doc/src/sgml/ref/prepare.sgml,v retrieving revision 1.10 diff -2 -c -r1.10 prepare.sgml *** doc/src/sgml/ref/prepare.sgml 14 Dec 2003 00:55:46 -0000 1.10 --- doc/src/sgml/ref/prepare.sgml 26 Jan 2004 07:33:16 -0000 *************** *** 140,143 **** --- 140,165 ---- </refsect1> + <refsect1 id="sql-prepare-examples"> + <title id="sql-prepare-examples-title">Examples</title> + <para> + This example creates a prepared query <literal>fooplan</> which + inserts data into <literal>foo</>, and then executes 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> + This example prepares a <command>SELECT</> statement: + <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>
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly