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 ---- + 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 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 ---- + + Examples + + This example creates a prepared query fooplan which + inserts data into foo, and then executes it: + + 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'); + + + + + This example prepares a SELECT statement: + + 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); + + + Compatibility