Debian Codegraph @

doc/html/pgtcl-pgsendquery.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.6.0">
6 <title>pg_sendquery</title>
7 <meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
8 <link rev="MADE" href="mailto:[email protected]">
9 <link rel="HOME" title="PostgreSQL Tcl Interface Documentation" href="index.html">
10 <link rel="UP" title="pgtcl Command Reference" href="libpgtcl-ref.html">
11 <link rel="PREVIOUS" title="pg_on_connection_loss" href="pgtcl-pgon-connection-loss.html">
12 <link rel="NEXT" title="pg_sendquery_prepared" href="pgtcl-pgsendqueryprepared.html">
13 <link rel="STYLESHEET" type="text/css" href="stylesheet.css">
14 </head>
15 <body class="REFENTRY">
16 <div class="NAVHEADER">
17 <table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
18 <tr>
19 <th colspan="5" align="center" valign="bottom">PostgreSQL Tcl Interface Documentation</th>
20 </tr>
21 <tr>
22 <td width="10%" align="left" valign="top"><a href="pgtcl-pgon-connection-loss.html" accesskey="P">Prev</a></td>
23 <td width="10%" align="left" valign="top"><a href="pgtcl-pgon-connection-loss.html">Fast Backward</a></td>
24 <td width="60%" align="center" valign="bottom"></td>
25 <td width="10%" align="right" valign="top"><a href="pgtcl-pgsendqueryprepared.html">Fast Forward</a></td>
26 <td width="10%" align="right" valign="top"><a href="pgtcl-pgsendqueryprepared.html" accesskey="N">Next</a></td>
27 </tr>
28 </table>
29 <hr align="left" width="100%"></div>
30 <h1><a name="PGTCL-PGSENDQUERY" id="PGTCL-PGSENDQUERY"></a>pg_sendquery</h1>
31 <div class="REFNAMEDIV"><a name="AEN1494" id="AEN1494"></a>
32 <h2>Name</h2>
33 pg_sendquery&nbsp;--&nbsp;send a query string to the backend connection without waiting for a result<a name="IX-PGTCL-PGSENDQUERY-2" id="IX-PGTCL-PGSENDQUERY-2"></a></div>
34 <div class="REFSYNOPSISDIV"><a name="AEN1499" id="AEN1499"></a>
35 <h2>Synopsis</h2>
36 <pre class="SYNOPSIS">pg_sendquery [<span class="OPTIONAL"><code class="PARAMETER">-paramarray</code> [<span class="OPTIONAL"><code class="PARAMETER">-variables</code></span>] arrayVar</span>] <code class="PARAMETER">conn</code> <code class="PARAMETER">commandString</code> ?<span class="OPTIONAL"><code class="PARAMETER">args</code></span>?</pre></div>
37 <div class="REFSECT1"><a name="AEN1509" id="AEN1509"></a>
38 <h2>Description</h2>
39 <p><code class="FUNCTION">pg_sendquery</code> submits a command to the <span class="PRODUCTNAME">PostgreSQL</span> server. This function works like <code class="FUNCTION">pg_exec</code>, except that it does not return a result. Rather, the command is issued to the backend asynchronously.</p>
40 <p>The result is either an error message or nothing. An empty return indicates that the command was dispatched to the backend.</p>
41 <p>If the [<span class="OPTIONAL">-paramarray</span>] flag is provided, then a substitution is performed on the query, securely replacing each back-quote delimited name with the corresponding entry from the named array. If the array does not contain the named element, then NULL is substituted (similarly to the way an array created by -withoutnulls is generated). Each such name must occur in a location where a value or field name could appear. See pg_select for more info.</p>
42 <p>If the [<span class="OPTIONAL">-variables</span>] flag is provided, then embedded Tcl variables are passed as parameters. Variables can be flagged with ':' and array references and namespaces are supported. Complex variable names can usually be embedded with :{nasty-name-here} though no attempt at duplicating Tcl brace-escaping is made. If the variable does not exist, then NULL is substituted. Each such name must occur in a location where a value or field name could appear. See pg_select for more info.</p>
43 </div>
44 <div class="REFSECT1"><a name="AEN1520" id="AEN1520"></a>
45 <h2>Arguments</h2>
46 <div class="VARIABLELIST">
47 <dl>
48 <dt>[<span class="OPTIONAL">-paramarray arrayname</span>]</dt>
49 <dd>
50 <p>Perform parameter substitution via `quoted` elements of the array using PQexecParams or PQSendQueryParams.</p>
51 </dd>
52 <dt>[<span class="OPTIONAL">-variables</span>]</dt>
53 <dd>
54 <p>Substitute Tcl variables found in the SQL string using PQexecParams or PQSendQueryParams.</p>
55 </dd>
56 <dt><code class="PARAMETER">conn</code></dt>
57 <dd>
58 <p>The handle of the connection on which to execute the command.</p>
59 </dd>
60 <dt><code class="PARAMETER">commandString</code></dt>
61 <dd>
62 <p>The SQL command to execute.</p>
63 </dd>
64 <dt><code class="PARAMETER">args</code></dt>
65 <dd>
66 <p>For <span class="PRODUCTNAME">PostgreSQL</span> versions greater than 7.4, <code class="PARAMETER">args</code> consists of zero or more optional values that can be inserted, unquoted, into the SQL statement using $-style substitution. Nulls are represented by the string "NULL".</p>
67 </dd>
68 </dl>
69 </div>
70 </div>
71 <div class="REFSECT1"><a name="AEN1550" id="AEN1550"></a>
72 <h2>Return Value</h2>
73 <p>A Tcl error will be returned if <span class="APPLICATION">pgtcl</span> was unable to issue the command. Otherwise, an empty string will be return. It is up to the developer to use <code class="FUNCTION">pg_getresult</code> to obtain results from commands issued with <code class="FUNCTION">pg_sendquery</code>.</p>
74 </div>
75 <div class="NAVFOOTER">
76 <hr align="left" width="100%">
77 <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
78 <tr>
79 <td width="33%" align="left" valign="top"><a href="pgtcl-pgon-connection-loss.html" accesskey="P">Prev</a></td>
80 <td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td>
81 <td width="33%" align="right" valign="top"><a href="pgtcl-pgsendqueryprepared.html" accesskey="N">Next</a></td>
82 </tr>
83 <tr>
84 <td width="33%" align="left" valign="top">pg_on_connection_loss</td>
85 <td width="34%" align="center" valign="top"><a href="libpgtcl-ref.html" accesskey="U">Up</a></td>
86 <td width="33%" align="right" valign="top">pg_sendquery_prepared</td>
87 </tr>
88 </table>
89 </div>
90 </body>
91 </html>