</refsect1>
<refsect1>
<title>Compatibility</title>
<para>
<command>DESCRIBE</command> is specified in the SQL standard.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member><xref linkend="ecpg-sql-allocate-descriptor"/></member>
<member><xref linkend="ecpg-sql-get-descriptor"/></member>
</simplelist>
</refsect1>
</refentry>
<refentry id="ecpg-sql-disconnect">
<refnamediv>
<refname>DISCONNECT</refname>
<refpurpose>terminate a database connection</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
DISCONNECT <replaceable class="parameter">connection_name</replaceable>
DISCONNECT [ CURRENT ]
DISCONNECT ALL
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>DISCONNECT</command> closes a connection (or all
connections) to the database.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry id="ecpg-sql-disconnect-connection-name">
<term><replaceable class="parameter">connection_name</replaceable></term>
<listitem>
<para>
A database connection name established by
the <command>CONNECT</command> command.
</para>
</listitem>
</varlistentry>
<varlistentry id="ecpg-sql-disconnect-current">
<term><literal>CURRENT</literal></term>
<listitem>
<para>
Close the <quote>current</quote> connection, which is either
the most recently opened connection, or the connection set by
the <command>SET CONNECTION</command> command. This is also
the default if no argument is given to
the <command>DISCONNECT</command> command.
</para>
</listitem>
</varlistentry>
<varlistentry id="ecpg-sql-disconnect-all">
<term><literal>ALL</literal></term>
<listitem>
<para>
Close all open connections.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Examples</title>
<programlisting>
int
main(void)
{
EXEC SQL CONNECT TO testdb AS con1 USER testuser;
EXEC SQL CONNECT TO testdb AS con2 USER testuser;
EXEC SQL CONNECT TO testdb AS con3 USER testuser;
EXEC SQL DISCONNECT CURRENT; /* close con3 */
EXEC SQL DISCONNECT ALL; /* close con2 and con1 */
return 0;
}
</programlisting>
</refsect1>
<refsect1>
<title>Compatibility</title>
<para>
<command>DISCONNECT</command> is specified in the SQL standard.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member><xref linkend="ecpg-sql-connect"/></member>
<member><xref linkend="ecpg-sql-set-connection"/></member>
</simplelist>
</refsect1>
</refentry>
<refentry id="ecpg-sql-execute-immediate">
<refnamediv>
<refname>EXECUTE IMMEDIATE</refname>
<refpurpose>dynamically prepare and execute a statement</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
EXECUTE IMMEDIATE <replaceable class="parameter">string</replaceable>
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>EXECUTE IMMEDIATE</command> immediately prepares and
executes a dynamically specified SQL statement, without
retrieving result rows.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry id="ecpg-sql-execute-immediate-string">
<term><replaceable class="parameter">string</replaceable></term>
<listitem>
<para>
A literal string or a host variable containing the SQL
statement to be executed.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
In typical usage, the <replaceable>string</replaceable> is a host
variable