<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vertica Documentation – Statements</title>
    <link>/en/sql-reference/statements/</link>
    <description>Recent content in Statements on Vertica Documentation</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/statements/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: ACTIVATE DIRECTED QUERY</title>
      <link>/en/sql-reference/statements/activate-directed-query/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/activate-directed-query/</guid>
      <description>
        
        
        &lt;p&gt;Activates a directed query and makes it available to the query optimizer across all sessions.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ACTIVATE DIRECTED QUERY { &lt;span class=&#34;code-variable&#34;&gt;query-name&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/where-clause/&#34;&gt;where-clause&lt;/a&gt;&lt;/span&gt; }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;query‑name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the directed query to activate, as stored in the &lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/directed-queries/&#34;&gt;DIRECTED_QUERIES&lt;/a&gt; column &lt;code&gt;query_name&lt;/code&gt;. You can also use &lt;a href=&#34;../../../en/sql-reference/statements/get-directed-query/&#34;&gt;GET DIRECTED QUERY&lt;/a&gt; to obtain names of all directed queries that map to an input query.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;*&lt;/code&gt;where‑clause&lt;code&gt;*&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Resolves to one or more directed queries that are filtered from system table &lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/directed-queries/&#34;&gt;DIRECTED_QUERIES&lt;/a&gt;. For example, the following statement activates all directed queries with the same &lt;code&gt;save_plans_version&lt;/code&gt; identifier:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ACTIVATE DIRECTED QUERY WHERE save_plans_version = 21;
&lt;/code&gt;&lt;/pre&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/db-superuser/&#34; title=&#34;&#34;&gt;Superuser&lt;/a&gt;
&lt;h2 id=&#34;activation-life-cycle&#34;&gt;Activation life cycle&lt;/h2&gt;
&lt;p&gt;After you activate a directed query, it remains active until it is explicitly deactivated by &lt;a href=&#34;../../../en/sql-reference/statements/deactivate-directed-query/&#34;&gt;DEACTIVATE DIRECTED QUERY&lt;/a&gt; or removed from storage by &lt;a href=&#34;../../../en/sql-reference/statements/drop-statements/drop-directed-query/&#34;&gt;DROP DIRECTED QUERY&lt;/a&gt;. If a directed query is active at the time of database shutdown, Vertica automatically reactivates it when you restart the database.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/managing-directed-queries/activating-and-deactivating-directed-queries/&#34;&gt;Activating and deactivating directed queries&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: ALTER statements</title>
      <link>/en/sql-reference/statements/alter-statements/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/alter-statements/</guid>
      <description>
        
        
        &lt;p&gt;ALTER statements let you change existing database objects.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: BEGIN</title>
      <link>/en/sql-reference/statements/begin/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/begin/</guid>
      <description>
        
        
        &lt;p&gt;Starts a transaction block.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

BEGIN is a synonym for &lt;a href=&#34;../../../en/sql-reference/statements/start-transaction/&#34;&gt;START TRANSACTION&lt;/a&gt;.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;BEGIN [ WORK | TRANSACTION ] [ &lt;span class=&#34;code-variable&#34;&gt;isolation‑level&lt;/span&gt; ] [ READ [ONLY] | WRITE ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;WORK | TRANSACTION&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional keywords for readability only.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;isolation‑level&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the transaction&#39;s isolation level, which determines what data the transaction can access when other transactions are running concurrently, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/admin/transactions/read-committed-isolation/&#34;&gt;READ COMMITTED&lt;/a&gt; (default)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/admin/transactions/serializable-isolation/&#34;&gt;SERIALIZABLE&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;REPEATABLE READ (automatically converted to SERIALIZABLE)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;READ UNCOMMITTED (automatically converted to READ COMMITTED)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details, see &lt;a href=&#34;../../../en/admin/transactions/&#34;&gt;Transactions&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;READ [ONLY] | WRITE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the transaction mode, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;READ WRITE (default): Transaction is read/write.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;READ ONLY: Transaction is read-only.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Setting the transaction session mode to read-only disallows the following SQL statements, but does not prevent all disk write operations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;INSERT, UPDATE, DELETE, and COPY if the target table is not a temporary table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;All CREATE, ALTER, and DROP commands&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;GRANT, REVOKE, and EXPLAIN if the SQL to run is one of the statements cited above.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Create a transaction with the isolation level set to READ COMMITTED and the transaction mode to READ WRITE:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED READ WRITE;
BEGIN
=&amp;gt; CREATE TABLE sample_table (a INT);
CREATE TABLE
=&amp;gt; INSERT INTO sample_table (a) VALUES (1);
OUTPUT
--------
1
(1 row)

=&amp;gt; END;
COMMIT
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/transactions/&#34;&gt;Transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/inserting-data-ado-net/creating-and-rolling-back-transactions/&#34;&gt;Creating and rolling back transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/end/&#34;&gt;END&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/rollback/&#34;&gt;ROLLBACK&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: CALL</title>
      <link>/en/sql-reference/statements/call/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/call/</guid>
      <description>
        
        
        &lt;p&gt;Invokes a &lt;a href=&#34;../../../en/extending/stored-procedures/&#34;&gt;stored procedure&lt;/a&gt; created with &lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-procedure-stored/&#34;&gt;CREATE PROCEDURE (stored)&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CALL [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;procedure&lt;/span&gt;( [ &lt;span class=&#34;code-variable&#34;&gt;argument-list&lt;/span&gt;] );
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;procedure&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The name of the stored procedure, where &lt;em&gt;&lt;code&gt;procedure&lt;/code&gt;&lt;/em&gt; conforms to conventions described in &lt;a href=&#34;../../../en/sql-reference/language-elements/identifiers/&#34;&gt;Identifiers&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;argument-list&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of arguments to pass to the stored procedure, whose types correspond to the types of the argument&#39;s &lt;a href=&#34;../../../en/extending/stored-procedures/parameter-modes/&#34;&gt;IN parameters&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser: EXECUTE on the procedure&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/extending/stored-procedures/executing-stored-procedures/&#34;&gt;Executing stored procedures&lt;/a&gt; and &lt;a href=&#34;../../../en/extending/stored-procedures/stored-procedures-use-cases-and-examples/&#34;&gt;Stored procedures: use cases and examples&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/do/&#34;&gt;DO&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-procedure-stored/&#34;&gt;CREATE PROCEDURE (stored)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/drop-statements/drop-procedure-stored/&#34;&gt;DROP PROCEDURE (stored)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: COMMENT ON statements</title>
      <link>/en/sql-reference/statements/comment-on-statements/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/comment-on-statements/</guid>
      <description>
        
        
        &lt;p&gt;&lt;code&gt;COMMENT ON&lt;/code&gt; statements let you create comments on database objects, such as schemas, tables, and libraries. Each object can have one comment. Comments are stored in the system table 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/comments/&#34;&gt;COMMENTS&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: COMMIT</title>
      <link>/en/sql-reference/statements/commit/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/commit/</guid>
      <description>
        
        
        &lt;p&gt;Ends the current transaction and makes all changes that occurred during the transaction permanent and visible to other users.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;COMMIT&lt;/code&gt; is a synonym for 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/end/&#34;&gt;END&lt;/a&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;COMMIT [ WORK | TRANSACTION ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;WORK TRANSACTION&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional keywords for readability only.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;This example shows how to commit an insert.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE sample_table (a INT);
=&amp;gt; INSERT INTO sample_table (a) VALUES (1);
OUTPUT
--------
1
=&amp;gt; COMMIT;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/transactions/&#34;&gt;Transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/inserting-data-ado-net/creating-and-rolling-back-transactions/&#34;&gt;Creating and rolling back transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/begin/&#34;&gt;BEGIN&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/rollback/&#34;&gt;ROLLBACK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/start-transaction/&#34;&gt;START TRANSACTION&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: CONNECT TO VERTICA</title>
      <link>/en/sql-reference/statements/connect-to/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/connect-to/</guid>
      <description>
        
        
        &lt;p&gt;Connects to another Vertica database to enable importing and exporting data across Vertica databases, with 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/copy-from/&#34;&gt;COPY FROM VERTICA&lt;/a&gt;&lt;/code&gt; and 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/export-to/&#34;&gt;EXPORT TO VERTICA&lt;/a&gt;&lt;/code&gt;, respectively.&lt;/p&gt;
&lt;p&gt;After you establish a connection to another database, the connection remains open in the current session until you explicitly close it with 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/disconnect/&#34;&gt;DISCONNECT&lt;/a&gt;&lt;/code&gt;. You can have only one connection to another database at a time. However, you can establish successive connections to different databases in the same session.&lt;/p&gt;
&lt;p&gt;By default, invoking &lt;code&gt;CONNECT TO VERTICA&lt;/code&gt; occurs over the Vertica private network. For information about creating a connection over a public network, see &lt;a href=&#34;../../../en/data-export/db-export-and-import/using-public-and-private-ip-networks/&#34;&gt;Using public and private IP networks&lt;/a&gt;.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
Copy and export operations can fail if either side of the connection is a single-node cluster installed on &lt;code&gt;localhost&lt;/code&gt;.
&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CONNECT TO VERTICA &lt;span class=&#34;code-variable&#34;&gt;db‑spec&lt;/span&gt; USER &lt;span class=&#34;code-variable&#34;&gt;username&lt;/span&gt; PASSWORD &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;password&lt;/span&gt;&amp;#39; ON &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;host&lt;/span&gt;&amp;#39;, &lt;span class=&#34;code-variable&#34;&gt;port&lt;/span&gt;
    [ TLS CONFIGURATION &lt;span class=&#34;code-variable&#34;&gt;tls_configuration&lt;/span&gt; ]
    [ TLSMODE PREFER ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;db‑spec&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The target database, either the database name or &lt;code&gt;DEFAULT&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;username&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The username to use when connecting to the other database.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;password&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A string containing the password to use to connect to the target database.
&lt;p&gt;If the target database has no password, and you supply one, the connection succeeds; however, Vertica returns no indication that you supplied an incorrect password.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;host&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A string containing the host name of one of the nodes in the other database.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;port&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The port number of the other database as an integer.&lt;/dd&gt;
&lt;dt&gt;TLS CONFIGURATION &lt;em&gt;&lt;code&gt;tls_configuration&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-tls-config/&#34;&gt;TLS Configuration&lt;/a&gt; to use for TLS. The TLS Configuration is ignored if &lt;code&gt;ImportExportTLSMode&lt;/code&gt; is set to any of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;REQUIRE_FORCE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;VERIFY_CA_FORCE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;VERIFY_FULL_FORCE&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The effective TLS mode of CONNECT TO VERTICA changes depending on the TLSMODE of the TLS Configuration and the value of &lt;a href=&#34;../../../en/sql-reference/config-parameters/security-parameters/#importexporttlsmode&#34;&gt;ImportExportTLSMode&lt;/a&gt; (for non-FORCE values). For details, see &lt;a href=&#34;#tlsmode&#34;&gt;Effective TLSMode&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;TLSMODE PREFER&lt;/dt&gt;
&lt;dd&gt;
&lt;div class=&#34;admonition deprecated&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Deprecated&lt;/h4&gt;

This parameter has been superseded by the TLS CONFIGURATION parameter. TLSMODE PREFER only takes effect if TLS CONFIGURATION is not set.

&lt;/div&gt;
&lt;p&gt;Overrides the value of configuration parameter 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/config-parameters/security-parameters/&#34;&gt;ImportExportTLSMode&lt;/a&gt;&lt;/code&gt; for this connection to &lt;code&gt;PREFER&lt;/code&gt;. If TLS CONFIGURATION is set or &lt;code&gt;ImportExportTLSMode&lt;/code&gt; is set to REQUIRE_FORCE, VERIFY_CA_FORCE, or VERIFY_FULL_FORCE, then TLSMODE PREFER has no effect.&lt;/p&gt;
&lt;p&gt;If TLSMODE PREFER and &lt;code&gt;ImportExportTLSMode&lt;/code&gt; are both not set, CONNECT TO VERTICA uses ENABLE.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;&lt;a name=&#34;tlsmode&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;effective-tls-mode&#34;&gt;Effective TLS mode&lt;/h2&gt;
&lt;p&gt;The effective TLS mode of CONNECT TO VERTICA is determined by the TLSMODE of the TLS Configuration and the value of ImportExportTLSMode. The following table summarizes this interaction for non-FORCE values of ImportExportTLSMode:

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
TLS Configuration&lt;/th&gt; 

&lt;th &gt;
ImportExportTLSMode&lt;/th&gt; 

&lt;th &gt;
Effective TLS mode&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
ENABLE&lt;/td&gt; 

&lt;td &gt;
PREFER&lt;/td&gt; 

&lt;td &gt;
PREFER&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
ENABLE&lt;/td&gt; 

&lt;td &gt;
Anything except PREFER&lt;/td&gt; 

&lt;td &gt;
REQUIRE&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
TRY_VERIFY, VERIFY_CA&lt;/td&gt; 

&lt;td &gt;
Anything&lt;/td&gt; 

&lt;td &gt;
VERIFY_CA&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
VERIFY_FULL&lt;/td&gt; 

&lt;td &gt;
Anything&lt;/td&gt; 

&lt;td &gt;
VERIFY_FULL&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;security-requirements&#34;&gt;Security requirements&lt;/h2&gt;
&lt;p&gt;When importing from or exporting to a Vertica database, you can connect only to a database that uses trusted (username only) or password-based authentication, as described in &lt;a href=&#34;../../../en/security-and-authentication/&#34;&gt;Security and authentication&lt;/a&gt;. SSL authentication is not supported.&lt;/p&gt;

&lt;p&gt;If configured with a certificate, Vertica encrypts data during transmission using TLS and attempts to encrypt plan metadata. You can set configuration parameter 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/config-parameters/security-parameters/&#34;&gt;ImportExportTLSMode&lt;/a&gt;&lt;/code&gt; to require encryption for plan metadata.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CONNECT TO VERTICA ExampleDB USER dbadmin PASSWORD &amp;#39;Password123&amp;#39; ON &amp;#39;VerticaHost01&amp;#39;,5433;
CONNECT
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: COPY</title>
      <link>/en/sql-reference/statements/copy/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/copy/</guid>
      <description>
        
        
        &lt;p&gt;COPY bulk-loads data into a Vertica database. By default, COPY automatically commits itself and any current transaction except when loading temporary tables. If COPY is terminated or interrupted Vertica rolls it back.&lt;/p&gt;
&lt;p&gt;COPY reads data as UTF-8 encoding.&lt;/p&gt;
&lt;p&gt;For information on loading one or more files or pipes on a cluster host or on a client system, see &lt;a href=&#34;../../../en/sql-reference/statements/copy-local/&#34;&gt;COPY LOCAL&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;COPY [ /*+ LABEL (&lt;span class=&#34;code-variable&#34;&gt;label‑string&lt;/span&gt;)*/ ] [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema-name.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;target-table&lt;/span&gt;
   [ ( { &lt;span class=&#34;code-variable&#34;&gt;column-as-expression&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt; }
       [ DELIMITER [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; ]
       [ ENCLOSED [ BY ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; ]
       [ ENFORCELENGTH ]
       [ ESCAPE [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; | NO ESCAPE ]
       [ FILLER &lt;span class=&#34;code-variable&#34;&gt;datatype&lt;/span&gt;]
       [ FORMAT &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;format&lt;/span&gt;&amp;#39; ]
       [ NULL [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39; ]
       [ TRIM &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;byte&lt;/span&gt;&amp;#39; ]
       [,...] ) ]
   [ COLUMN OPTION (&lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt;
       [ DELIMITER [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; ]
       [ ENCLOSED [ BY ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; ]
       [ ENFORCELENGTH ]
       [ ESCAPE [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; | NO ESCAPE ]
       [ FORMAT &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;format&lt;/span&gt;&amp;#39; ]
       [ NULL [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39; ]
       [ TRIM &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;byte&lt;/span&gt;&amp;#39; ]
     [,...] ) ]
FROM {
   [ LOCAL ] STDIN [ &lt;span class=&#34;code-variable&#34;&gt;compression&lt;/span&gt; ]
   | { &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;path-to-data&lt;/span&gt;&amp;#39;
       [ ON { &lt;span class=&#34;code-variable&#34;&gt;nodename&lt;/span&gt; | (&lt;span class=&#34;code-variable&#34;&gt;nodeset&lt;/span&gt;) | ANY NODE | EACH NODE } ] [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/copy/parameters/compression&#34;&gt;compression&lt;/a&gt;&lt;/span&gt; ] }[,...]
     [ PARTITION COLUMNS &lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt;[,...] ]
   | &lt;a href=&#34;../../../en/sql-reference/statements/copy-local/&#34;&gt;LOCAL&lt;/a&gt; &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;&lt;span class=&#34;code-variable&#34;&gt;path-to-data&lt;/span&gt;&lt;/span&gt;&amp;#39; [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/copy/parameters/compression&#34;&gt;compression&lt;/a&gt;&lt;/span&gt; ] [,...]
   | &lt;a href=&#34;../../../en/sql-reference/statements/copy-from/&#34;&gt;VERTICA&lt;/a&gt; &lt;span class=&#34;code-variable&#34;&gt;source-database.&lt;/span&gt;[&lt;span class=&#34;code-variable&#34;&gt;source-schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;source-table&lt;/span&gt;[(&lt;span class=&#34;code-variable&#34;&gt; source-column&lt;/span&gt;[,...] ) ]
  }
  [ NATIVE
    | FIXEDWIDTH COLSIZES {( &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; )[,...]}
    | NATIVE VARCHAR
    | ORC
    | PARQUET
  ]
  | [ WITH ] &lt;span class=&#34;code-variable&#34;&gt;UDL-clause&lt;/span&gt;[...]
}
   [ ABORT ON ERROR ]
   [ DELIMITER [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; ]
   [ ENCLOSED [ BY ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39;
   [ ENFORCELENGTH ]
   [ ERROR TOLERANCE ]
   [ ESCAPE [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;char&lt;/span&gt;&amp;#39; | NO ESCAPE ]
   [ EXCEPTIONS &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;&amp;#39; [ ON &lt;span class=&#34;code-variable&#34;&gt;nodename&lt;/span&gt;] [,...]
   [ NULL [ AS ] &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39; ]
   [ RECORD TERMINATOR &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39; ]
   [ REJECTED DATA {&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;&amp;#39; [ ON &lt;span class=&#34;code-variable&#34;&gt;nodename&lt;/span&gt;]&lt;span class=&#34;code-input&#34;&gt; &lt;/span&gt;[,...] | AS TABLE &lt;span class=&#34;code-variable&#34;&gt;reject-table&lt;/span&gt;} ]
   [ REJECTMAX &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ]
   [ SKIP &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ]
   [ SKIP BYTES &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ]
   [ STREAM NAME  &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;streamName&lt;/span&gt;&amp;#39;]
   [ TRAILING NULLCOLS ]
   [ TRIM &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;byte&lt;/span&gt;&amp;#39; ]
   [ [ WITH ] PARSER &lt;span class=&#34;code-variable&#34;&gt;parser &lt;/span&gt;([ &lt;span class=&#34;code-variable&#34;&gt;arg&lt;/span&gt;=&lt;span class=&#34;code-variable&#34;&gt;value&lt;/span&gt;[,...] ]) ] ]
   [ NO COMMIT ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/sql-reference/statements/copy/parameters/&#34;&gt;Parameters&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/sql-reference/statements/copy/restrictions/&#34;&gt;Restrictions&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;&lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/db-superuser/&#34; title=&#34;&#34;&gt;Superusers&lt;/a&gt; have full COPY privileges. The following requirements apply to non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;INSERT privilege on table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on schema&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USER-accessible storage location&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Applicable READ or WRITE privileges granted to the storage location where files are read or written&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;COPY can specify a path to store rejected data and exceptions. If the path resolves to a storage location, the following privileges apply to non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The storage location was created with the USER option (see &lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-location/&#34;&gt;CREATE LOCATION&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The user must has READ access to the storage location, as described in &lt;a href=&#34;../../../en/sql-reference/statements/grant-statements/grant-storage-location/&#34;&gt;GRANT (storage location)&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: COPY FROM VERTICA</title>
      <link>/en/sql-reference/statements/copy-from/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/copy-from/</guid>
      <description>
        
        
        &lt;p&gt;Imports data from another Vertica database. &lt;span class=&#34;sql&#34;&gt;COPY FROM VERTICA&lt;/span&gt; is similar to &lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt;&lt;/span&gt;, but supports only a subset of its parameters.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The source database must be no more than one major release behind the target database.
&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;COPY [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema-name.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;target-table&lt;/span&gt;
    [( &lt;span class=&#34;code-variable&#34;&gt;target‑columns&lt;/span&gt; )]
    FROM VERTICA &lt;span class=&#34;code-variable&#34;&gt;source‑database&lt;/span&gt;.[&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;source‑table&lt;/span&gt;
    [( &lt;span class=&#34;code-variable&#34;&gt;source‑columns&lt;/span&gt; )]
    [STREAM NAME &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;stream name&lt;/span&gt;&amp;#39;]
    [NO COMMIT]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;`[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;target‑table&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The target table for the imported data. Vertica loads the data into all projections that include columns from the schema table.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;target‑columns&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of columns in &lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt; to store the copied data.See &lt;a href=&#34;#Mapping&#34;&gt;Mapping Between Target and Source Columns&lt;/a&gt; below.
&lt;p&gt;You cannot use FILLER columns or columns of &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/&#34;&gt;complex types&lt;/a&gt;, except native arrays, as part of the column definition.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;source‑database&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The source database of the data to import. A connection to this database must already exist in the current session before starting the copy operation; otherwise Vertica returns an error. For details, see 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/connect-to/&#34;&gt;CONNECT TO VERTICA&lt;/a&gt;&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;source‑table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table that is the source of the imported data. If &lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt; is any schema other than &lt;code&gt;public&lt;/code&gt;, you must supply the schema name.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;source‑columns&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of the columns in the source table to import. If omitted, all columns are exported.Columns cannot be of complex types. See &lt;a href=&#34;#Mapping&#34;&gt;Mapping Between Target and Source Columns&lt;/a&gt; below.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;STREAM NAME&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;A &lt;span class=&#34;sql&#34;&gt;COPY&lt;/span&gt; load stream identifier. Using a stream name helps to quickly identify a particular load. The &lt;span class=&#34;sql&#34;&gt;STREAM NAME&lt;/span&gt; value that you specify in the load statement appears in the &lt;code&gt;stream&lt;/code&gt; column of the &lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/load-streams/&#34;&gt;&lt;code&gt;LOAD_STREAMS&lt;/code&gt;&lt;/a&gt; system table.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;NO COMMIT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Prevents &lt;code&gt;COPY&lt;/code&gt; from committing its transaction automatically when it finishes copying data. For details, see &lt;a href=&#34;../../../en/data-load/using-transactions-to-stage-load/&#34;&gt;Using transactions to stage a load&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Source table: SELECT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Source table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Target table: INSERT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Target table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a name=&#34;Mapping&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;mapping-between-target-and-source-columns&#34;&gt;Mapping between target and source columns&lt;/h2&gt;
&lt;p&gt;If you copy all table data from one database to another, &lt;span class=&#34;sql&#34;&gt;COPY FROM VERTICA&lt;/span&gt; can omit specifying column lists if column definitions in both tables comply with the following conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Same number of columns&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Identical column names&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Same sequence of columns&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Matching or &lt;a href=&#34;../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt; column data types&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;No complex data types (ARRAY, SET, or ROW), except for native arrays&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If any of these conditions is not true, the &lt;span class=&#34;sql&#34;&gt;COPY FROM VERTICA&lt;/span&gt; statement must include column lists that explicitly map target and source columns to each other, as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Contain the same number of columns.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;List source and target columns in the same order.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pair columns with the same (or &lt;a href=&#34;../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt;) data types.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;node-failure-during-copy&#34;&gt;Node failure during COPY&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/data-export/db-export-and-import/handling-node-failure-during-copyexport/&#34;&gt;Handling node failure during copy/export&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example copies the contents of an entire table from the &lt;code&gt;vmart&lt;/code&gt; database to an identically-defined table in the current database:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CONNECT TO VERTICA vmart USER dbadmin PASSWORD &amp;#39;myPassword&amp;#39; ON &amp;#39;VertTest01&amp;#39;,5433;
CONNECT
=&amp;gt; COPY customer_dimension FROM  VERTICA vmart.customer_dimension;
 Rows Loaded
-------------
      500000
(1 row)
=&amp;gt; DISCONNECT vmart;
DISCONNECT
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For more examples, see &lt;a href=&#34;../../../en/data-export/db-export-and-import/copying-data-from-another-db/&#34;&gt;Copying data from another Vertica database&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/export-to/&#34;&gt;EXPORT TO VERTICA&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: COPY LOCAL</title>
      <link>/en/sql-reference/statements/copy-local/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/copy-local/</guid>
      <description>
        
        
        &lt;p&gt;Using the COPY statement with its &lt;code&gt;LOCAL&lt;/code&gt; option lets you load a data file on a client system, rather than on a cluster host. COPY LOCAL supports the &lt;code&gt;STDIN&lt;/code&gt; and &lt;code&gt;&#39;pathToData&#39;&lt;/code&gt; parameters, but not the &lt;code&gt;[ON nodename]&lt;/code&gt; clause. COPY LOCAL does not support multiple file batches in NATIVE or NATIVE VARCHAR formats. COPY LOCAL does not support reading ORC or Parquet files; use ON NODE instead. COPY LOCAL does not support CURRENT_LOAD_SOURCE().&lt;/p&gt;
&lt;p&gt;The COPY LOCAL option is platform-independent. The statement works in the same way across all supported Vertica platforms and drivers. For more details about supported drivers, see &lt;a href=&#34;../../../en/connecting-to/client-libraries/client-drivers/&#34;&gt;Client drivers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;COPY LOCAL must be the first statement in any multi-statement query you make with the ODBC client library. Using it as the second or later statement results in an error. When using other client libraries, such as JDBC, COPY LOCAL should always be the first statement in a multi-statement query. Also, do not use it multiple times in the same query.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

On Windows clients, the path you supply for the COPY LOCAL file is limited to 216 characters due to limitations in the Windows API.

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;COPY LOCAL&lt;/code&gt; does not automatically create exceptions and rejections files, even if exceptions occur.&lt;/p&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;User must have INSERT privilege on the table and USAGE privilege on the schema.&lt;/p&gt;
&lt;h2 id=&#34;how-copy-local-works&#34;&gt;How copy local works&lt;/h2&gt;
&lt;p&gt;COPY LOCAL loads data in a platform-neutral way. The COPY LOCAL statement loads all files from a local client system to the Vertica host, where the server processes the files. You can copy files in various formats: uncompressed, compressed, fixed-width format, in bzip or gzip format, or specified as a bash glob. Files of a single format (such as all bzip, or gzip) can be comma-separated in the list of input files. You can also use any of the applicable COPY statement options (as long as the data format supports the option). For instance, you can define a specific delimiter character, or how to handle NULLs, and so forth.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The Linux &lt;code&gt;glob&lt;/code&gt; command returns files that match the pattern you enter, as specified in the &lt;a href=&#34;http://linux.die.net/man/7/glob&#34;&gt;Linux Manual Page for Glob (7)&lt;/a&gt;. For ADO.net platforms, specify patterns and wildcards as described in the .NET &lt;a href=&#34;http://msdn.microsoft.com/en-us/library/wz42302f.aspx&#34;&gt;Directory.getFiles Method&lt;/a&gt;.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;For more information about using the &lt;code&gt;COPY LOCAL&lt;/code&gt; option to load data, see &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt; for syntactical descriptions, and &lt;a href=&#34;../../../en/data-load/specifying-where-to-load-data-from/&#34;&gt;Specifying where to load data from&lt;/a&gt; for detailed examples.&lt;/p&gt;
&lt;p&gt;The Vertica host uncompresses and processes the files as necessary, regardless of file format or the client platform from which you load the files. Once the server has the copied files, Vertica maintains performance by distributing file parsing tasks, such as encoding, compressing, uncompressing, across nodes.&lt;/p&gt;
&lt;h2 id=&#34;viewing-copy-local-operations-in-a-query-plan&#34;&gt;Viewing copy local operations in a query plan&lt;/h2&gt;
&lt;p&gt;When you use the &lt;code&gt;COPY LOCAL&lt;/code&gt; option, the GraphViz query plan includes a label for &lt;code&gt;Load-Client-File&lt;/code&gt;, rather than &lt;code&gt;Load-File&lt;/code&gt;. Following is a section from a sample query plan:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;-----------------------------------------------
  PLAN:  BASE BULKLOAD PLAN  (GraphViz Format)
-----------------------------------------------
 digraph G {
 graph [rankdir=BT, label = &amp;#34; BASE BULKLOAD PLAN \nAll Nodes Vector:
 \n\n  node[0]=initiator (initiator) Up\n&amp;#34;, labelloc=t, labeljust=l ordering=out]
.
.
.
10[label = &amp;#34;&lt;span class=&#34;code-input&#34;&gt;Load-Client-File(/tmp/diff)&lt;/span&gt; \nOutBlk=[UncTuple]&amp;#34;,
color = &amp;#34;green&amp;#34;, shape = &amp;#34;ellipse&amp;#34;];
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example shows a load from a local file.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ cat &amp;gt; t.dat
12
17
9
^C

=&amp;gt; CREATE TABLE numbers (value INT);
CREATE TABLE

=&amp;gt; COPY numbers FROM LOCAL &amp;#39;t.dat&amp;#39;;
 Rows Loaded
-------------
           3
(1 row)

=&amp;gt; SELECT * FROM numbers;
 value
-------
    12
    17
     9
(3 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: CREATE statements</title>
      <link>/en/sql-reference/statements/create-statements/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/</guid>
      <description>
        
        
        &lt;p&gt;CREATE statements let you create new database objects such as tables and users.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DEACTIVATE DIRECTED QUERY</title>
      <link>/en/sql-reference/statements/deactivate-directed-query/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/deactivate-directed-query/</guid>
      <description>
        
        
        &lt;p&gt;Deactivates one or more directed queries previously activated by &lt;a href=&#34;../../../en/sql-reference/statements/activate-directed-query/&#34;&gt;ACTIVATE DIRECTED QUERY&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DEACTIVATE DIRECTED QUERY { &lt;span class=&#34;code-variable&#34;&gt;query-name&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;input-query&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/where-clause/&#34;&gt;where-clause&lt;/a&gt;&lt;/span&gt; }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;query‑name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the directed query to deactivate, as stored in the &lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/directed-queries/&#34;&gt;DIRECTED_QUERIES&lt;/a&gt; column &lt;code&gt;query_name&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;input‑query&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The input query of the directed queries to deactivate. Use this argument to deactivate multiple direct queries that map to the same input query.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;*&lt;/code&gt;where‑clause&lt;code&gt;*&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Resolves to one or more directed queries that are filtered from system table &lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/directed-queries/&#34;&gt;DIRECTED_QUERIES&lt;/a&gt;. For example, the following statement specifies to deactivate all directed queries with the same &lt;code&gt;save_plans_version&lt;/code&gt; identifier:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; DEACTIVATE DIRECTED QUERY WHERE save_plans_version = 21;
&lt;/code&gt;&lt;/pre&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/db-superuser/&#34; title=&#34;&#34;&gt;Superuser&lt;/a&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/managing-directed-queries/activating-and-deactivating-directed-queries/&#34;&gt;Activating and deactivating directed queries&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DELETE</title>
      <link>/en/sql-reference/statements/delete/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/delete/</guid>
      <description>
        
        
        &lt;p&gt;Removes the specified rows from a table and returns a count of the deleted rows. A count of 0 is not an error, but indicates that no rows matched the condition. An unqualified &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; statement (one that omits a &lt;span class=&#34;sql&#34;&gt;WHERE&lt;/span&gt; clause) removes all rows but leaves intact table columns, projections, and constraints.&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; supports subqueries and joins, so you can delete values in a table based on values in other tables.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The Vertica implementation of DELETE differs from traditional databases: it does not delete data from disk storage, but instead marks rows as deleted so they are available for historical queries. Deleted data remains on disk, and counts against disk quota, until purged.
&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DELETE [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label‑string&lt;/span&gt;)*/ ]  FROM [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt; [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/where-clause/&#34;&gt;where-clause&lt;/a&gt;&lt;/span&gt; ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Any table, including temporary tables.&lt;/dd&gt;
&lt;dt&gt;&lt;span class=&#34;code-variable&#34;&gt;[where‑clause](/en/sql-reference/statements/select/where-clause/)&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;Which rows to mark for deletion. If you omit this clause, &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; behavior varies depending on whether the table is persistent or temporary. See below for details.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Table owner or user with GRANT OPTION is grantor.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;DELETE privilege on table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on the schema of the target table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;SELECT privilege on a table when the &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; statement includes a &lt;span class=&#34;sql&#34;&gt;WHERE&lt;/span&gt; or &lt;span class=&#34;sql&#34;&gt;SET&lt;/span&gt; clause that specifies columns from that table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;p&gt;You cannot execute &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; on an &lt;a href=&#34;../../../en/admin/working-with-native-tables/immutable-tables/&#34;&gt;immutable table&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;committing-successive-table-changes&#34;&gt;Committing successive table changes&lt;/h2&gt;
&lt;p&gt;Vertica follows the SQL-92 transaction model, so successive INSERT, UPDATE, and DELETE statements are included in the same transaction. You do not need to explicitly start this transaction; however, you must explicitly end it with &lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt;, or implicitly end it with &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt;. Otherwise, Vertica discards all changes that were made within the transaction.&lt;/p&gt;

&lt;h2 id=&#34;persistent-and-temporary-tables&#34;&gt;Persistent and temporary tables&lt;/h2&gt;
&lt;p&gt;When deleting from a persistent table, &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; removes data directly from the ROS.&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; execution on temporary tables varies, depending on whether the table was created with &lt;span class=&#34;sql&#34;&gt;ON COMMIT DELETE ROWS&lt;/span&gt; (default) or &lt;span class=&#34;sql&#34;&gt;ON COMMIT PRESERVE ROWS&lt;/span&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; contains a &lt;span class=&#34;sql&#34;&gt;WHERE&lt;/span&gt; clause that specifies which rows to remove, behavior is identical: &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; marks the rows for deletion. In both cases, you cannot roll back to an earlier savepoint.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; omits a &lt;span class=&#34;sql&#34;&gt;WHERE&lt;/span&gt; clause and the table was created with &lt;span class=&#34;sql&#34;&gt;ON COMMIT PRESERVE ROWS&lt;/span&gt;, Vertica marks all table rows for deletion. If the table was created with &lt;span class=&#34;sql&#34;&gt;ON COMMIT DELETE ROWS&lt;/span&gt;, &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; behaves like &lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/truncate-table/&#34;&gt;TRUNCATE TABLE&lt;/a&gt;&lt;/span&gt; and removes all rows from storage.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If you issue an unqualified &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; statement on a temporary table created with &lt;span class=&#34;sql&#34;&gt;ON COMMIT DELETE ROWS&lt;/span&gt;, Vertica removes all rows from storage but does not end the transaction.

&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following statement removes all rows from a temporary table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; DELETE FROM temp1;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following statement deletes all records from a schema-qualified table where a condition is satisfied:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; DELETE FROM retail.customer WHERE state IN (&amp;#39;MA&amp;#39;, &amp;#39;NH&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For examples that show how to nest a subquery within a &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; statement, see &lt;a href=&#34;../../../en/data-analysis/queries/subqueries/subqueries-update-and-delete-statements/&#34;&gt;Subqueries in UPDATE and DELETE&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/drop-statements/drop-table/&#34;&gt;DROP TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/truncate-table/&#34;&gt;TRUNCATE TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/working-with-native-tables/removing-table-data/&#34;&gt;Removing table data&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/working-with-native-tables/removing-table-data/optimizing-delete-and-update/&#34;&gt;Optimizing DELETE and UPDATE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DISCONNECT</title>
      <link>/en/sql-reference/statements/disconnect/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/disconnect/</guid>
      <description>
        
        
        &lt;p&gt;Closes a connection to another Vertica database that was opened in the same session with 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/connect-to/&#34;&gt;CONNECT TO VERTICA&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

Closing your session also closes the database connection. However, it is a good practice to explicitly close the connection to the other database, both to free up resources and to prevent issues with other SQL scripts that might be running in your session. Always closing the connection prevents potential errors if you run a script in the same session that attempts to open a connection to the same database, since each session can only have one connection to a given database at a time.

&lt;/div&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DISCONNECT &lt;span class=&#34;code-variable&#34;&gt;db‑spec&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;db‑spec&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;Specifies the target database, either the database name or &lt;code&gt;DEFAULT&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; DISCONNECT DEFAULT;
DISCONNECT
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DO</title>
      <link>/en/sql-reference/statements/do/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/do/</guid>
      <description>
        
        
        &lt;p&gt;Executes an anonymous (unnamed) &lt;a href=&#34;../../../en/extending/stored-procedures/&#34;&gt;stored procedure&lt;/a&gt; without saving it.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DO [ LANGUAGE &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;language-name&lt;/span&gt;&amp;#39; ] $$
    &lt;span class=&#34;code-variable&#34;&gt;source&lt;/span&gt;
$$;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;language-name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the language of the procedure &lt;em&gt;&lt;code&gt;source&lt;/code&gt;&lt;/em&gt;, one of the following (both options refer to &lt;a href=&#34;../../../en/extending/stored-procedures/plvsql/&#34;&gt;PLvSQL&lt;/a&gt;; PLpgSQL is included to maintain compatibility with existing scripts):
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;PLvSQL&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;PLpgSQL&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;PLvSQL&lt;/code&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;source&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The source code of the procedure.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;For more complex examples, see &lt;a href=&#34;../../../en/extending/stored-procedures/stored-procedures-use-cases-and-examples/&#34;&gt;Stored procedures: use cases and examples&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This procedure prints the variables in the DECLARE block:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DO LANGUAGE PLvSQL $$
DECLARE
    x int := 3;
    y varchar := &amp;#39;some string&amp;#39;;
BEGIN
    RAISE NOTICE &amp;#39;x = %&amp;#39;, x;
    RAISE NOTICE &amp;#39;y = %&amp;#39;, y;
END;
$$;

NOTICE 2005:  x = 3
NOTICE 2005:  y = some string
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For more information on RAISE NOTICE, see &lt;a href=&#34;../../../en/extending/stored-procedures/plvsql/errors-and-diagnostics/&#34;&gt;Errors and diagnostics&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/extending/stored-procedures/&#34;&gt;Stored procedures&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/extending/stored-procedures/plvsql/&#34;&gt;PL/vSQL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-procedure-stored/&#34;&gt;CREATE PROCEDURE (stored)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DROP statements</title>
      <link>/en/sql-reference/statements/drop-statements/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/drop-statements/</guid>
      <description>
        
        
        &lt;p&gt;DROP statements let you delete database objects such as schemas, tables, and users.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: END</title>
      <link>/en/sql-reference/statements/end/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/end/</guid>
      <description>
        
        
        &lt;p&gt;Ends the current transaction and makes all changes that occurred during the transaction permanent and visible to other users.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt; is a synonym for END.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;END [ WORK | TRANSACTION ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;WORK | TRANSACTION&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional keywords that have no effect, for readability only.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED READ WRITE;
BEGIN
=&amp;gt; CREATE TABLE sample_table (a INT);
CREATE TABLE
=&amp;gt; INSERT INTO sample_table (a) VALUES (1);
OUTPUT
--------
1
(1 row)

=&amp;gt; END;
COMMIT
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/transactions/&#34;&gt;Transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/inserting-data-ado-net/creating-and-rolling-back-transactions/&#34;&gt;Creating and rolling back transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/begin/&#34;&gt;BEGIN&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/rollback/&#34;&gt;ROLLBACK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/start-transaction/&#34;&gt;START TRANSACTION&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPLAIN</title>
      <link>/en/sql-reference/statements/explain/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/explain/</guid>
      <description>
        
        
        &lt;p&gt;Returns a formatted description of the Vertica optimizer&#39;s plan for executing the specified statement.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EXPLAIN [/*+ &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/allnodes/&#34;&gt;ALLNODES&lt;/a&gt; */] [&lt;span class=&#34;code-variable&#34;&gt;explain-options&lt;/span&gt;] &lt;span class=&#34;code-variable&#34;&gt;sql-statement&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;/*+&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/allnodes/&#34;&gt;ALLNODES&lt;/a&gt;*/&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies to create a query plan that assumes all nodes are active, not valid with &lt;code&gt;LOCAL&lt;/code&gt; option.&lt;/dd&gt;
&lt;dt&gt;&lt;a name=&#34;explain-options&#34;&gt;&lt;/a&gt;&lt;em&gt;&lt;code&gt;explain‑options&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;One or more &lt;code&gt;EXPLAIN&lt;/code&gt; options, specified in the order shown:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[ LOCAL ] [ VERBOSE ] [ JSON ] [ ANNOTATED ]
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;LOCAL&lt;/code&gt;: On a multi-node database, shows the local query plans assigned to each node, which together comprise the total (global) query plan. If you omit this option, Vertica shows only the global query plan. Local query plans are shown only in DOT language source, which can be rendered in &lt;a href=&#34;http://graphviz.org/&#34;&gt;Graphviz&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This option is incompatible with the hint &lt;code&gt;/*+ALLNODES*/&lt;/code&gt;. If you specify both, EXPLAIN returns with an error.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;VERBOSE&lt;/code&gt;: Increases the level of detail in the rendered query plan.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;JSON&lt;/code&gt;: Renders the query plan in JSON format. This option is compatible only with &lt;code&gt;VERBOSE&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ANNOTATED&lt;/code&gt;: Embeds &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/&#34;&gt;optimizer hints&lt;/a&gt; that encapsulate the query plan for this query. This option is compatible with &lt;code&gt;LOCAL&lt;/code&gt; and &lt;code&gt;VERBOSE&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;sql‑statement&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A query or DML statement—for example, &lt;a href=&#34;../../../en/sql-reference/statements/select/&#34;&gt;SELECT&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/statements/insert/&#34;&gt;INSERT&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/statements/update/&#34;&gt;UPDATE&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt;, and &lt;a href=&#34;../../../en/sql-reference/statements/merge/&#34;&gt;MERGE&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;The same privileges required by the specified statement.&lt;/p&gt;
&lt;h2 id=&#34;requirements&#34;&gt;Requirements&lt;/h2&gt;
&lt;p&gt;The following requirements apply to EXPLAIN&#39;s ability to produce useful information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reasonably representative statistics of your data must be available. See &lt;a href=&#34;../../../en/admin/collecting-db-statistics/&#34;&gt;Collecting Statistics&lt;/a&gt; for details.&lt;/li&gt;
&lt;li&gt;EXPLAIN produces useful output only if projections are available for the queried tables.&lt;/li&gt;
&lt;li&gt;Qualifier options must be specified in the order shown &lt;a href=&#34;#explain-options&#34;&gt;earlier&lt;/a&gt;, otherwise EXPLAIN returns with an error. If an option is incompatible with any preceding options, EXPLAIN ignores them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/managing-queries/query-plans/viewing-query-plans/&#34;&gt;Viewing query plans&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPORT TO DELIMITED</title>
      <link>/en/sql-reference/statements/export-to-delimited/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/export-to-delimited/</guid>
      <description>
        
        
        &lt;p&gt;Exports a table, columns from a table, or query results to delimited files. The files can be read back in using &lt;a href=&#34;../../../en/sql-reference/statements/copy/parsers/delimited/&#34;&gt;DELIMITED&lt;/a&gt;. Several exporter parameters have corresponding parser parameters, allowing you to change delimiters, null indicators, and other formatting.&lt;/p&gt;
&lt;p&gt;There are some limitations on the queries you can use in an export statement. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can export data stored in Vertica in ROS format		and data from external tables.&lt;/p&gt;
&lt;p&gt;This statement returns the number of rows written and logs information about exported files in a system table. See &lt;a href=&#34;../../../en/data-export/file-export/monitoring-exports/&#34;&gt;Monitoring exports&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;During an export to HDFS or an NFS mount point, Vertica writes files to a temporary directory in the same location as the destination and renames the directory when the export is complete. Do not attempt to use the files in the temporary directory. During an export to S3, GCS, or Azure, Vertica writes files directly to the destination path, so you must wait for the export to finish before reading the files. For more information, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EXPORT [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label-string&lt;/span&gt;)*/ ] TO DELIMITED ( directory=&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;param=value&lt;/span&gt; [,...] ]
   [ OVER (&lt;span class=&#34;code-variable&#34;&gt;over-clause&lt;/span&gt; ) ] AS SELECT &lt;span class=&#34;code-variable&#34;&gt;query-expression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;over-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies how to partition table data using PARTITION BY. Within partitions you can sort using ORDER BY. See &lt;a href=&#34;../../../en/data-analysis/sql-analytics/&#34;&gt;SQL analytics&lt;/a&gt;. This clause may contain column references but not expressions.
&lt;p&gt;If you partition data, Vertica creates a partition directory structure, transforming column names to lowercase. See &lt;a href=&#34;../../../en/data-load/working-with-external-data/partitioned-file-paths/&#34;&gt;Partitioned file paths&lt;/a&gt; for a description of the directory structure. If you use the &lt;code&gt;fileName&lt;/code&gt; parameter, you cannot use partitioning.&lt;/p&gt;
&lt;p&gt;If you omit this clause, Vertica optimizes for maximum parallelism.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;query-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the data to export. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt; for important limitations.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;directory&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The destination directory for the output files. The directory must not exist, and the current user must have permission to write it. The 						destination can be on any of the following file systems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/hdfs-file-system/&#34;&gt;HDFS file system&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/s3-object-store/&#34;&gt;S3 object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/google-cloud-storage-gcs-object-store/&#34;&gt;Google Cloud Storage (GCS) object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/azure-blob-storage-object-store/&#34;&gt;Azure Blob Storage object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Linux file system, either an NFS mount or local storage on each node&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If specified, all output is written to a single file of this name in the location specified by &lt;code&gt;directory&lt;/code&gt;. While the query can be processed by multiple nodes, only a single node generates the output data. The &lt;code&gt;fileSizeMB&lt;/code&gt; parameter is ignored, and the query cannot use partitioning in the OVER() clause.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;addHeader&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Boolean, specifies whether to add a header row to the beginning of each file.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; false&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;delimiter&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Column delimiter character. To produce CSV in accordance with RFC 4180, set the delimiter character to &lt;code&gt;,&lt;/code&gt; (comma).
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;|&lt;/code&gt; (vertical bar)&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;recordTerminator&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Character that marks the record end.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;\n&lt;/code&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;enclosedBy&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Character to use to enclose string and date/time data. If you omit this parameter, no character encloses these data types.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;&#39;&#39;&lt;/code&gt; (empty string)&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;escapeAs&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Character to use to escape values in exported data that must be escaped, including the &lt;code&gt;enclosedBy&lt;/code&gt; value.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;\&lt;/code&gt; (backslash)&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;nullAs&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;String to represent null values in the data. If this parameter is included, the exporter exports all null values as this value. Otherwise, the exporter exports null values as zero-length strings.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;binaryTypesFormat&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Format for exported &lt;a href=&#34;../../../en/sql-reference/data-types/binary-data-types-binary-and-varbinary/&#34;&gt;binary data type&lt;/a&gt; (BINARY, VARBINARY, and LONG VARBINARY) values, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Default&lt;/code&gt;: Printable ASCII characters where possible and escaped octal representations of the non-printable bytes. The DELIMITED parser reads this format.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Hex&lt;/code&gt;: Base 16 (hexadecimal) representation; value is preceded by &#39;0x&#39; and bytes are not escaped.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Octal&lt;/code&gt;: Base 8 (octal) representation, without escaping.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Bitstring&lt;/code&gt;: Binary representation, without escaping.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, the value &lt;code&gt;a\000b\001c&lt;/code&gt; can be exported as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Default (assuming an escape character of &lt;code&gt;\&lt;/code&gt;): &lt;code&gt;a\\000b\\001c&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hex: &lt;code&gt;0x6100620163&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Octal: &lt;code&gt;141000142001143&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Bitstring: &lt;code&gt;0110000100000000011000100000000101100011&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;compression&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Compression type, one of:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Uncompressed&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BZip&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;GZip&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; Uncompressed&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileExtension&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Output file extension. If using compression, a compression-specific extension such as &lt;code&gt;.bz2&lt;/code&gt; is appended.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;csv&lt;/code&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileSizeMB&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The maximum file size of a single output file. This value is a hint, not a hard limit. A value of 0 specifies no limit. If &lt;code&gt;filename&lt;/code&gt; is also specified, &lt;code&gt;fileSizeMB&lt;/code&gt; is ignored.&lt;/p&gt;
&lt;p&gt;This value affects the size of individual output files, not the total output size. For smaller values, Vertica divides the output into more files; all data is still exported.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 10GB&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported files. You can specify the value in Unix octal format (such as &lt;code&gt;665&lt;/code&gt;) or &lt;em&gt;&lt;code&gt;user&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;group&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;other&lt;/code&gt;&lt;/em&gt; format—for example, &lt;code&gt;rwxr-xr-x&lt;/code&gt;. The value must be formatted as a string even if using the octal format.&lt;/p&gt;
&lt;p&gt;Valid octal values range between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1777&lt;/code&gt;, inclusive. See &lt;a href=&#34;https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html&#34;&gt;HDFS Permissions&lt;/a&gt; in the Apache Hadoop documentation.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;660&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;dirMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported directories. Values follow the same rules as those for &lt;em&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/em&gt;. Further, you must give the Vertica HDFS user full permission, at least &lt;code&gt;rwx------&lt;/code&gt; or &lt;code&gt;700&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;755&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Source table: SELECT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Source table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Destination directory: Write&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a name=&#34;Query&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;query-restrictions&#34;&gt;Query restrictions&lt;/h2&gt;
&lt;p&gt;You must provide an alias column label for selected column targets that are expressions.&lt;/p&gt;
&lt;p&gt;If you partition the output, you cannot specify schema and table names in the SELECT statement. Specify only the column name.&lt;/p&gt;
&lt;p&gt;The query can contain only a single outer SELECT statement. For example, you cannot use UNION:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO DELIMITED(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
   UNION ALL
   SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash;
ERROR 8975:  Only a single outer SELECT statement is supported
HINT:  Please use a subquery for multiple outer SELECT statements
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead, rewrite the query to use a subquery:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO DELIMITED(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT
    account_id,
    json
   FROM
   (
     SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
     UNION ALL
     SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash
   ) a;
 Rows Exported
---------------
             2
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use composite statements such as UNION, INTERSECT, and EXCEPT, rewrite them as subqueries.&lt;/p&gt;
&lt;h2 id=&#34;data-types&#34;&gt;Data types&lt;/h2&gt;
&lt;p&gt;EXPORT TO DELIMITED does not support ARRAY, ROW, and SET types.&lt;/p&gt;
&lt;p&gt;This operation exports raw Flex columns as binary data.&lt;/p&gt;
&lt;h2 id=&#34;output&#34;&gt;Output&lt;/h2&gt;
&lt;p&gt;The export operation always creates an output directory, even if all output is written to a single file or the query produces zero rows.&lt;/p&gt;
&lt;p&gt;Output file names follow the pattern: &lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;8-character-hash&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;nodename&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;thread-id&lt;/code&gt;&lt;/em&gt;&lt;code&gt;].&lt;/code&gt;&lt;em&gt;&lt;code&gt;fileExtension&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Column names in partition directories are lowercase.&lt;/p&gt;
&lt;p&gt;Files exported to a local file system by any Vertica user are owned by the Vertica superuser. Files exported to HDFS or object stores are owned by the Vertica user who exported the data.&lt;/p&gt;
&lt;p&gt;Making concurrent exports to the same output destination is an error and can produce incorrect results.&lt;/p&gt;
&lt;p&gt;Exports to the local file system can be to an NFS mount (shared) or to the Linux file system on each node (non-shared). For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-linux-file-system/&#34;&gt;Exporting to the Linux file system&lt;/a&gt;. Exports to non-shared local file systems have the following restrictions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The output directory must not exist on any node.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have a USER storage location or superuser privileges.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You cannot override the permissions mode of 700 for directories and 600 for files.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Exports to object-store file systems are not atomic. Be careful to wait for the export to finish before using the data. For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example exports uncompressed comma-separated values (CSV) with a header row in each file:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO DELIMITED(directory=&amp;#39;webhdfs:///user1/data&amp;#39;, delimiter=&amp;#39;,&amp;#39;, addHeader=&amp;#39;true&amp;#39;)
  AS SELECT * FROM public.sales;
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPORT TO JSON</title>
      <link>/en/sql-reference/statements/export-to-json/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/export-to-json/</guid>
      <description>
        
        
        &lt;p&gt;Exports a table, columns from a table, or query results to JSON files. The files can be read back into Vertica using &lt;a href=&#34;../../../en/sql-reference/statements/copy/parsers/fjsonparser/&#34;&gt;FJSONPARSER&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are some limitations on the queries you can use in an export statement. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can export data stored in Vertica in ROS format		and data from external tables.&lt;/p&gt;
&lt;p&gt;This statement returns the number of rows written and logs information about exported files in a system table. See &lt;a href=&#34;../../../en/data-export/file-export/monitoring-exports/&#34;&gt;Monitoring exports&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;During an export to HDFS or an NFS mount point, Vertica writes files to a temporary directory in the same location as the destination and renames the directory when the export is complete. Do not attempt to use the files in the temporary directory. During an export to S3, GCS, or Azure, Vertica writes files directly to the destination path, so you must wait for the export to finish before reading the files. For more information, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
EXPORT [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label&lt;/span&gt;)*/ ] TO JSON ( directory=&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;param=value&lt;/span&gt; [,...] ]
   [ OVER (&lt;span class=&#34;code-variable&#34;&gt;over-clause&lt;/span&gt; ) ] AS SELECT &lt;span class=&#34;code-variable&#34;&gt;query-expression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;over-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies how to partition table data using PARTITION BY. Within partitions you can sort using ORDER BY. See &lt;a href=&#34;../../../en/data-analysis/sql-analytics/&#34;&gt;SQL analytics&lt;/a&gt;. This clause may contain column references but not expressions.
&lt;p&gt;If you partition data, Vertica creates a partition directory structure, transforming column names to lowercase. See &lt;a href=&#34;../../../en/data-load/working-with-external-data/partitioned-file-paths/&#34;&gt;Partitioned file paths&lt;/a&gt; for a description of the directory structure. If you use the &lt;code&gt;fileName&lt;/code&gt; parameter, you cannot use partitioning.&lt;/p&gt;
&lt;p&gt;If you omit this clause, Vertica optimizes for maximum parallelism.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;query-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the data to export. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt; for important limitations.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;directory&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The destination directory for the output files. The directory must not exist, and the current user must have permission to write it. The 						destination can be on any of the following file systems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/hdfs-file-system/&#34;&gt;HDFS file system&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/s3-object-store/&#34;&gt;S3 object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/google-cloud-storage-gcs-object-store/&#34;&gt;Google Cloud Storage (GCS) object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/azure-blob-storage-object-store/&#34;&gt;Azure Blob Storage object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Linux file system, either an NFS mount or local storage on each node&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If specified, all output is written to a single file of this name in the location specified by &lt;code&gt;directory&lt;/code&gt;. While the query can be processed by multiple nodes, only a single node generates the output data. The &lt;code&gt;fileSizeMB&lt;/code&gt; parameter is ignored, and the query cannot use partitioning in the OVER() clause.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;omitNullFields&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Boolean, whether to omit &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/row/&#34;&gt;ROW&lt;/a&gt; fields with null values.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; false&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;compression&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Compression type, one of:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Uncompressed&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BZip&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;GZip&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; Uncompressed&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileSizeMB&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The maximum file size of a single output file. This value is a hint, not a hard limit. A value of 0 specifies no limit. If &lt;code&gt;filename&lt;/code&gt; is also specified, &lt;code&gt;fileSizeMB&lt;/code&gt; is ignored.&lt;/p&gt;
&lt;p&gt;This value affects the size of individual output files, not the total output size. For smaller values, Vertica divides the output into more files; all data is still exported.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 10GB&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported files. You can specify the value in Unix octal format (such as &lt;code&gt;665&lt;/code&gt;) or &lt;em&gt;&lt;code&gt;user&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;group&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;other&lt;/code&gt;&lt;/em&gt; format—for example, &lt;code&gt;rwxr-xr-x&lt;/code&gt;. The value must be formatted as a string even if using the octal format.&lt;/p&gt;
&lt;p&gt;Valid octal values range between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1777&lt;/code&gt;, inclusive. See &lt;a href=&#34;https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html&#34;&gt;HDFS Permissions&lt;/a&gt; in the Apache Hadoop documentation.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;660&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;dirMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported directories. Values follow the same rules as those for &lt;em&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/em&gt;. Further, you must give the Vertica HDFS user full permission, at least &lt;code&gt;rwx------&lt;/code&gt; or &lt;code&gt;700&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;755&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Source table: SELECT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Source table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Destination directory: Write&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a name=&#34;Query&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;query-restrictions&#34;&gt;Query restrictions&lt;/h2&gt;
&lt;p&gt;You must provide an alias column label for selected column targets that are expressions.&lt;/p&gt;
&lt;p&gt;If you partition the output, you cannot specify schema and table names in the SELECT statement. Specify only the column name.&lt;/p&gt;
&lt;p&gt;The query can contain only a single outer SELECT statement. For example, you cannot use UNION:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO JSON(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
   UNION ALL
   SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash;
ERROR 8975:  Only a single outer SELECT statement is supported
HINT:  Please use a subquery for multiple outer SELECT statements
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead, rewrite the query to use a subquery:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO JSON(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT
    account_id,
    json
   FROM
   (
     SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
     UNION ALL
     SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash
   ) a;
 Rows Exported
---------------
             2
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use composite statements such as UNION, INTERSECT, and EXCEPT, rewrite them as subqueries.&lt;/p&gt;
&lt;h2 id=&#34;data-types&#34;&gt;Data types&lt;/h2&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;EXPORT TO JSON&lt;/span&gt; can export &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/array/&#34;&gt;ARRAY&lt;/a&gt; and &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/row/&#34;&gt;ROW&lt;/a&gt; types in any combination.&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;EXPORT TO JSON&lt;/span&gt; does not support binary output (VARBINARY).&lt;/p&gt;
&lt;h2 id=&#34;output&#34;&gt;Output&lt;/h2&gt;
&lt;p&gt;The export operation always creates an output directory, even if all output is written to a single file or the query produces zero rows.&lt;/p&gt;
&lt;p&gt;Output file names follow the pattern: &lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;8-character-hash&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;nodename&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;thread-id&lt;/code&gt;&lt;/em&gt;&lt;code&gt;].json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Column names in partition directories are lowercase.&lt;/p&gt;
&lt;p&gt;Files exported to a local file system by any Vertica user are owned by the Vertica superuser. Files exported to HDFS or object stores are owned by the Vertica user who exported the data.&lt;/p&gt;
&lt;p&gt;Making concurrent exports to the same output destination is an error and can produce incorrect results.&lt;/p&gt;
&lt;p&gt;Exports to the local file system can be to an NFS mount (shared) or to the Linux file system on each node (non-shared). For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-linux-file-system/&#34;&gt;Exporting to the Linux file system&lt;/a&gt;. Exports to non-shared local file systems have the following restrictions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The output directory must not exist on any node.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have a USER storage location or superuser privileges.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You cannot override the permissions mode of 700 for directories and 600 for files.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Exports to object-store file systems are not atomic. Be careful to wait for the export to finish before using the data. For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;In the following example, one of the ROW elements has a null value, which is omitted in the output. EXPORT TO JSON writes each JSON record on one line; line breaks have been inserted into the following output for readability:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT name, menu FROM restaurants;
       name        |                                     menu

-------------------+------------------------------------------------------------
------------------
 Bob&amp;#39;s pizzeria    | [{&amp;#34;item&amp;#34;:&amp;#34;cheese pizza&amp;#34;,&lt;span class=&#34;code-input&#34;&gt;&#34;price&#34;:null&lt;/span&gt;},{&amp;#34;item&amp;#34;:&amp;#34;spinach pizza&amp;#34;,&amp;#34;price&amp;#34;:10.5}]
 Bakersfield Tacos | [{&amp;#34;item&amp;#34;:&amp;#34;veggie taco&amp;#34;,&amp;#34;price&amp;#34;:9.95},{&amp;#34;item&amp;#34;:&amp;#34;steak taco&amp;#34;,&amp;#34;price&amp;#34;:10.95}]
(2 rows)

=&amp;gt; EXPORT TO JSON (directory=&amp;#39;/output/json&amp;#39;, omitNullFields=true)
   AS SELECT * FROM restaurants;
 Rows Exported
---------------
             2
(1 row)

=&amp;gt; \! cat /output/json/*.json
{&amp;#34;name&amp;#34;:&amp;#34;Bob&amp;#39;s pizzeria&amp;#34;,&amp;#34;cuisine&amp;#34;:&amp;#34;Italian&amp;#34;,&amp;#34;location_city&amp;#34;:[&amp;#34;Cambridge&amp;#34;,&amp;#34;Pittsburgh&amp;#34;],
 &lt;span class=&#34;code-input&#34;&gt;&#34;menu&#34;:[{&#34;item&#34;:&#34;cheese pizza&#34;}&lt;/span&gt;,{&amp;#34;item&amp;#34;:&amp;#34;spinach pizza&amp;#34;,&amp;#34;price&amp;#34;:10.5}]}
{&amp;#34;name&amp;#34;:&amp;#34;Bakersfield Tacos&amp;#34;,&amp;#34;cuisine&amp;#34;:&amp;#34;Mexican&amp;#34;,&amp;#34;location_city&amp;#34;:[&amp;#34;Pittsburgh&amp;#34;],
 &amp;#34;menu&amp;#34;:[{&amp;#34;item&amp;#34;:&amp;#34;veggie taco&amp;#34;,&amp;#34;price&amp;#34;:9.95},{&amp;#34;item&amp;#34;:&amp;#34;steak taco&amp;#34;,&amp;#34;price&amp;#34;:10.95}]}
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPORT TO ORC</title>
      <link>/en/sql-reference/statements/export-to-orc/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/export-to-orc/</guid>
      <description>
        
        
        &lt;p&gt;Exports a table, columns from a table, or query results to files in the ORC format.&lt;/p&gt;
&lt;p&gt;You can use an OVER() clause to partition the data before export. You can partition data instead of or in addition to exporting the column data. Partitioning data can improve query performance by enabling partition pruning. See &lt;a href=&#34;../../../en/data-load/working-with-external-data/partitioned-file-paths/&#34;&gt;Partitioned file paths&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are some limitations on the queries you can use in an export statement. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can export data stored in Vertica in ROS format		and data from external tables.&lt;/p&gt;
&lt;p&gt;This statement returns the number of rows written and logs information about exported files in a system table. See &lt;a href=&#34;../../../en/data-export/file-export/monitoring-exports/&#34;&gt;Monitoring exports&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;During an export to HDFS or an NFS mount point, Vertica writes files to a temporary directory in the same location as the destination and renames the directory when the export is complete. Do not attempt to use the files in the temporary directory. During an export to S3, GCS, or Azure, Vertica writes files directly to the destination path, so you must wait for the export to finish before reading the files. For more information, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
EXPORT [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label-string&lt;/span&gt;)*/ ] TO ORC ( directory=&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;param=value&lt;/span&gt; [,...] ] )
   [ OVER (&lt;span class=&#34;code-variable&#34;&gt;over-clause&lt;/span&gt; ) ] AS SELECT &lt;span class=&#34;code-variable&#34;&gt;query-expression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;over-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies how to partition table data using PARTITION BY. Within partitions you can sort using ORDER BY. See &lt;a href=&#34;../../../en/data-analysis/sql-analytics/&#34;&gt;SQL analytics&lt;/a&gt;. This clause may contain column references but not expressions.
&lt;p&gt;If you partition data, Vertica creates a partition directory structure, transforming column names to lowercase. See &lt;a href=&#34;../../../en/data-load/working-with-external-data/partitioned-file-paths/&#34;&gt;Partitioned file paths&lt;/a&gt; for a description of the directory structure. If you use the &lt;code&gt;fileName&lt;/code&gt; parameter, you cannot use partitioning.&lt;/p&gt;
&lt;p&gt;If you omit this clause, Vertica optimizes for maximum parallelism.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;query-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the data to export. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt; for important limitations.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;directory&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The destination directory for the output files. The directory must not exist, and the current user must have permission to write it. The 						destination can be on any of the following file systems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/hdfs-file-system/&#34;&gt;HDFS file system&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/s3-object-store/&#34;&gt;S3 object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/google-cloud-storage-gcs-object-store/&#34;&gt;Google Cloud Storage (GCS) object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/azure-blob-storage-object-store/&#34;&gt;Azure Blob Storage object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Linux file system, either an NFS mount or local storage on each node&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If specified, all output is written to a single file of this name in the location specified by &lt;code&gt;directory&lt;/code&gt;. While the query can be processed by multiple nodes, only a single node generates the output data. The &lt;code&gt;fileSizeMB&lt;/code&gt; parameter is ignored, and the query cannot use partitioning in the OVER() clause.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;compression&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Column compression type, one of:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Zlib&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Uncompressed&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; Zlib&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;stripeSizeMB&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The uncompressed size of exported stripes in MB, an integer value between 1 and 1024, inclusive.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 250&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;rowIndexStride&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Integer that specifies how frequently the exporter builds indexing statistics in the output, between 1 and 1000000 (1 million), inclusive. A value of 0 disables indexing. The exporter builds statistics after every &lt;code&gt;rowIndexStride&lt;/code&gt; rows in each stripe, or once for stripes &amp;lt; &lt;code&gt;rowIndexStride&lt;/code&gt;.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1000&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileSizeMB&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The maximum file size of a single output file. This value is a hint, not a hard limit. A value of 0 specifies no limit. If &lt;code&gt;filename&lt;/code&gt; is also specified, &lt;code&gt;fileSizeMB&lt;/code&gt; is ignored.&lt;/p&gt;
&lt;p&gt;This value affects the size of individual output files, not the total output size. For smaller values, Vertica divides the output into more files; all data is still exported.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 10GB&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported files. You can specify the value in Unix octal format (such as &lt;code&gt;665&lt;/code&gt;) or &lt;em&gt;&lt;code&gt;user&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;group&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;other&lt;/code&gt;&lt;/em&gt; format—for example, &lt;code&gt;rwxr-xr-x&lt;/code&gt;. The value must be formatted as a string even if using the octal format.&lt;/p&gt;
&lt;p&gt;Valid octal values range between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1777&lt;/code&gt;, inclusive. See &lt;a href=&#34;https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html&#34;&gt;HDFS Permissions&lt;/a&gt; in the Apache Hadoop documentation.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;660&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;dirMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported directories. Values follow the same rules as those for &lt;em&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/em&gt;. Further, you must give the Vertica HDFS user full permission, at least &lt;code&gt;rwx------&lt;/code&gt; or &lt;code&gt;700&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;755&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Source table: SELECT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Source table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Destination directory: Write&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a name=&#34;Query&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;query-restrictions&#34;&gt;Query restrictions&lt;/h2&gt;
&lt;p&gt;You must provide an alias column label for selected column targets that are expressions.&lt;/p&gt;
&lt;p&gt;If you partition the output, you cannot specify schema and table names in the SELECT statement. Specify only the column name.&lt;/p&gt;
&lt;p&gt;The query can contain only a single outer SELECT statement. For example, you cannot use UNION:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO ORC(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
   UNION ALL
   SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash;
ERROR 8975:  Only a single outer SELECT statement is supported
HINT:  Please use a subquery for multiple outer SELECT statements
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead, rewrite the query to use a subquery:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO ORC(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT
    account_id,
    json
   FROM
   (
     SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
     UNION ALL
     SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash
   ) a;
 Rows Exported
---------------
             2
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use composite statements such as UNION, INTERSECT, and EXCEPT, rewrite them as subqueries.&lt;/p&gt;
&lt;h2 id=&#34;data-types&#34;&gt;Data types&lt;/h2&gt;
&lt;p&gt;EXPORT TO ORC converts Vertica data types to Hive data types as shown in the following table.

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Vertica Data Type&lt;/th&gt; 

&lt;th &gt;
Hive Data Type&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


INTEGER, BIGINT&lt;/td&gt; 

&lt;td &gt;


BIGINT&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


FLOAT, DECIMAL, SMALLINT, TINYINT, CHAR, BOOLEAN&lt;/td&gt; 

&lt;td &gt;


Corresponding Hive type&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
VARCHAR, LONG VARCHAR&lt;/td&gt; 

&lt;td &gt;
VARCHAR (max 64KB) or STRING (can be read as either)&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


BINARY, VARBINARY, LONG VARBINARY&lt;/td&gt; 

&lt;td &gt;


BINARY&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
DATE&lt;/td&gt; 

&lt;td &gt;


DATE if supported by your version of Hive, otherwise INT96 (can be read as TIMESTAMP)&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


TIMESTAMP, TIMESTAMPTZ&lt;/td&gt; 

&lt;td &gt;


TIMESTAMP. Vertica does not convert TIMESTAMP values to UTC. To avoid problems arising from time zones, use TIMESTAMPTZ instead of TIMESTAMP.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
TIME, TIMEZ, INTERVAL, UUID&lt;/td&gt; 

&lt;td &gt;
Not supported&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
ARRAY of scalar types&lt;/td&gt; 

&lt;td &gt;
ARRAY&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
ARRAY of complex types&lt;/td&gt; 

&lt;td &gt;
Not supported&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
SET, ROW&lt;/td&gt; 

&lt;td &gt;
Not supported&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;Decimal precision must be &amp;lt;= 38.&lt;/p&gt;
&lt;p&gt;The exported Hive types might not be identical to the Vertica types. For example, a Vertica INT is exported as a Hive BIGINT. When defining Hive external tables to read exported data, you might have to adjust column definitions.&lt;/p&gt;
&lt;p&gt;This operation exports raw Flex columns as binary data.&lt;/p&gt;
&lt;h2 id=&#34;output&#34;&gt;Output&lt;/h2&gt;
&lt;p&gt;The export operation always creates an output directory, even if all output is written to a single file or the query produces zero rows.&lt;/p&gt;
&lt;p&gt;Output file names follow the pattern: &lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;8-character-hash&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;nodename&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;thread-id&lt;/code&gt;&lt;/em&gt;&lt;code&gt;].orc&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Column names in partition directories are lowercase.&lt;/p&gt;
&lt;p&gt;Files exported to a local file system by any Vertica user are owned by the Vertica superuser. Files exported to HDFS or object stores are owned by the Vertica user who exported the data.&lt;/p&gt;
&lt;p&gt;Making concurrent exports to the same output destination is an error and can produce incorrect results.&lt;/p&gt;
&lt;p&gt;Exports to the local file system can be to an NFS mount (shared) or to the Linux file system on each node (non-shared). For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-linux-file-system/&#34;&gt;Exporting to the Linux file system&lt;/a&gt;. Exports to non-shared local file systems have the following restrictions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The output directory must not exist on any node.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have a USER storage location or superuser privileges.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You cannot override the permissions mode of 700 for directories and 600 for files.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Exports to object-store file systems are not atomic. Be careful to wait for the export to finish before using the data. For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example demonstrates partitioning and exporting data. EXPORT TO ORC first partitions the data on region and then, within each partition, sorts by store.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO ORC(directory=&amp;#39;gs://DataLake/user2/data&amp;#39;)
  OVER(PARTITION BY store.region ORDER BY store.ID)
  AS SELECT sale.price, sale.date, store.ID
  FROM public.sales sale
  JOIN public.vendor store ON sale.distribID = store.ID;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For more examples, see &lt;a href=&#34;../../../en/sql-reference/statements/export-to-parquet/&#34;&gt;EXPORT TO PARQUET&lt;/a&gt;, which (aside from a few parameters) behaves the same as EXPORT TO ORC.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPORT TO PARQUET</title>
      <link>/en/sql-reference/statements/export-to-parquet/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/export-to-parquet/</guid>
      <description>
        
        
        &lt;p&gt;Exports a table, columns from a table, or query results to files in the Parquet format.&lt;/p&gt;
&lt;p&gt;You can use an OVER() clause to partition the data before export. You can partition data instead of or in addition to exporting the column data. Partitioning data can improve query performance by enabling partition pruning. See &lt;a href=&#34;../../../en/data-load/working-with-external-data/partitioned-file-paths/&#34;&gt;Partitioned file paths&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are some limitations on the queries you can use in an export statement. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can export data stored in Vertica in ROS format		and data from external tables.&lt;/p&gt;
&lt;p&gt;This statement returns the number of rows written and logs information about exported files in a system table. See &lt;a href=&#34;../../../en/data-export/file-export/monitoring-exports/&#34;&gt;Monitoring exports&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;During an export to HDFS or an NFS mount point, Vertica writes files to a temporary directory in the same location as the destination and renames the directory when the export is complete. Do not attempt to use the files in the temporary directory. During an export to S3, GCS, or Azure, Vertica writes files directly to the destination path, so you must wait for the export to finish before reading the files. For more information, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After you export data, you can use the &lt;a href=&#34;../../../en/sql-reference/functions/hadoop-functions/get-metadata/&#34;&gt;GET_METADATA&lt;/a&gt; function to inspect the results.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
EXPORT [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label-string&lt;/span&gt;)*/ ] TO PARQUET ( directory=&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;param=value&lt;/span&gt; [,...] ] )
   [ OVER (&lt;span class=&#34;code-variable&#34;&gt;over-clause&lt;/span&gt; ) ] AS SELECT &lt;span class=&#34;code-variable&#34;&gt;query-expression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;over-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies how to partition table data using PARTITION BY. Within partitions you can sort using ORDER BY. See &lt;a href=&#34;../../../en/data-analysis/sql-analytics/&#34;&gt;SQL analytics&lt;/a&gt;. This clause may contain column references but not expressions.
&lt;p&gt;If you partition data, Vertica creates a partition directory structure, transforming column names to lowercase. See &lt;a href=&#34;../../../en/data-load/working-with-external-data/partitioned-file-paths/&#34;&gt;Partitioned file paths&lt;/a&gt; for a description of the directory structure. If you use the &lt;code&gt;fileName&lt;/code&gt; parameter, you cannot use partitioning.&lt;/p&gt;
&lt;p&gt;If you omit this clause, Vertica optimizes for maximum parallelism.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;query-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the data to export. See &lt;a href=&#34;#Query&#34;&gt;Query Restrictions&lt;/a&gt; for important limitations.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;directory&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The destination directory for the output files. The directory must not exist, and the current user must have permission to write it. The 						destination can be on any of the following file systems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/hdfs-file-system/&#34;&gt;HDFS file system&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/s3-object-store/&#34;&gt;S3 object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/google-cloud-storage-gcs-object-store/&#34;&gt;Google Cloud Storage (GCS) object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/file-systems-and-object-stores/azure-blob-storage-object-store/&#34;&gt;Azure Blob Storage object store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Linux file system, either an NFS mount or local storage on each node&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If specified, all output is written to a single file of this name in the location specified by &lt;code&gt;directory&lt;/code&gt;. While the query can be processed by multiple nodes, only a single node generates the output data. The &lt;code&gt;fileSizeMB&lt;/code&gt; parameter is ignored, and the query cannot use partitioning in the OVER() clause.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;compression&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Column compression type, one of:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Snappy&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;GZIP&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Brotli&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ZSTD&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Uncompressed&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; Snappy&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;rowGroupSizeMB&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The uncompressed size of exported row groups, in MB, an integer value between 1 and &lt;code&gt;fileSizeMB&lt;/code&gt; , inclusive, or unlimited if &lt;code&gt;fileSizeMB&lt;/code&gt; is 0.
&lt;p&gt;The row groups in the exported						files are smaller than this value because Parquet files are compressed on write. For best performance when exporting to HDFS, set &lt;em&gt;&lt;code&gt;size&lt;/code&gt;&lt;/em&gt; to be smaller than the HDFS block size.&lt;/p&gt;
&lt;p&gt;Row-group size affects memory consumption during export. An export thread consumes at least double the row-group size. The default value of 512MB is a compromise between writing larger row groups and allowing enough free memory for other Vertica operations. If you perform exports when the database is not otherwise under heavy load, you can improve read performance on the exported data by increasing row-group size on export. However, row groups that span multiple blocks on HDFS decrease read performance by requiring more I/O, so do not set the row-group size to be larger than your HDFS block size.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 512&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileSizeMB&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The maximum file size of a single output file. This value is a hint, not a hard limit. A value of 0 specifies no limit. If &lt;code&gt;filename&lt;/code&gt; is also specified, &lt;code&gt;fileSizeMB&lt;/code&gt; is ignored.&lt;/p&gt;
&lt;p&gt;This value affects the size of individual output files, not the total output size. For smaller values, Vertica divides the output into more files; all data is still exported.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 10GB&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported files. You can specify the value in Unix octal format (such as &lt;code&gt;665&lt;/code&gt;) or &lt;em&gt;&lt;code&gt;user&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;group&lt;/code&gt;&lt;/em&gt;&lt;code&gt;-&lt;/code&gt;&lt;em&gt;&lt;code&gt;other&lt;/code&gt;&lt;/em&gt; format—for example, &lt;code&gt;rwxr-xr-x&lt;/code&gt;. The value must be formatted as a string even if using the octal format.&lt;/p&gt;
&lt;p&gt;Valid octal values range between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1777&lt;/code&gt;, inclusive. See &lt;a href=&#34;https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html&#34;&gt;HDFS Permissions&lt;/a&gt; in the Apache Hadoop documentation.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;660&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;dirMode&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;For writes to HDFS only, permission to apply to all exported directories. Values follow the same rules as those for &lt;em&gt;&lt;code&gt;fileMode&lt;/code&gt;&lt;/em&gt;. Further, you must give the Vertica HDFS user full permission, at least &lt;code&gt;rwx------&lt;/code&gt; or &lt;code&gt;700&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When writing files to any destination other than HDFS, this parameter has no effect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;755&lt;/code&gt;, regardless of the value of &lt;code&gt;fs.permissions.umask-mode&lt;/code&gt; in &lt;code&gt;hdfs-site.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;int96AsTimestamp&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Boolean, specifies whether to export timestamps as int96 physical type (true) or int64 physical type (false).
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; true&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Source table: SELECT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Source table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Destination directory: Write&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a name=&#34;Query&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;query-restrictions&#34;&gt;Query restrictions&lt;/h2&gt;
&lt;p&gt;You must provide an alias column label for selected column targets that are expressions.&lt;/p&gt;
&lt;p&gt;If you partition the output, you cannot specify schema and table names in the SELECT statement. Specify only the column name.&lt;/p&gt;
&lt;p&gt;The query can contain only a single outer SELECT statement. For example, you cannot use UNION:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO PARQUET(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
   UNION ALL
   SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash;
ERROR 8975:  Only a single outer SELECT statement is supported
HINT:  Please use a subquery for multiple outer SELECT statements
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead, rewrite the query to use a subquery:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO PARQUET(directory = &amp;#39;/mnt/shared_nfs/accounts/rm&amp;#39;)
   OVER(PARTITION BY hash)
   AS
   SELECT
    account_id,
    json
   FROM
   (
     SELECT 1 as account_id, &amp;#39;{}&amp;#39; as json, 0 hash
     UNION ALL
     SELECT 2 as account_id, &amp;#39;{}&amp;#39; as json, 1 hash
   ) a;
 Rows Exported
---------------
             2
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use composite statements such as UNION, INTERSECT, and EXCEPT, rewrite them as subqueries.&lt;/p&gt;

&lt;h2 id=&#34;data-types&#34;&gt;Data types&lt;/h2&gt;
&lt;p&gt;EXPORT TO PARQUET converts Vertica data types to Hive data types as shown in the following table.

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Vertica Data Type&lt;/th&gt; 

&lt;th &gt;
Hive Data Type&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


INTEGER, BIGINT&lt;/td&gt; 

&lt;td &gt;


BIGINT&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


FLOAT, DECIMAL, SMALLINT, TINYINT, CHAR, BOOLEAN&lt;/td&gt; 

&lt;td &gt;


Corresponding Hive type&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
VARCHAR, LONG VARCHAR&lt;/td&gt; 

&lt;td &gt;
VARCHAR (max 64KB) or STRING (can be read as either)&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


BINARY, VARBINARY, LONG VARBINARY&lt;/td&gt; 

&lt;td &gt;


BINARY&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
DATE&lt;/td&gt; 

&lt;td &gt;


DATE if supported by your version of Hive, otherwise INT96 (can be read as TIMESTAMP)&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


TIMESTAMP, TIMESTAMPTZ&lt;/td&gt; 

&lt;td &gt;


TIMESTAMP. Vertica does not convert TIMESTAMP values to UTC. To avoid problems arising from time zones, use TIMESTAMPTZ instead of TIMESTAMP.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
TIME, TIMEZ, INTERVAL&lt;/td&gt; 

&lt;td &gt;
Not supported&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
ARRAY&lt;/td&gt; 

&lt;td &gt;
ARRAY&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
SET&lt;/td&gt; 

&lt;td &gt;
Not supported&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
ROW&lt;/td&gt; 

&lt;td &gt;
STRUCT&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;Decimal precision must be &amp;lt;= 38.&lt;/p&gt;
&lt;p&gt;The exported Hive types might not be identical to the Vertica types. For example, a Vertica INT is exported as a Hive BIGINT. When defining Hive external tables to read exported data, you might have to adjust column definitions.&lt;/p&gt;
&lt;p&gt;This operation exports raw Flex columns as binary data.&lt;/p&gt;
&lt;h2 id=&#34;output&#34;&gt;Output&lt;/h2&gt;
&lt;p&gt;The export operation always creates an output directory, even if all output is written to a single file or the query produces zero rows.&lt;/p&gt;
&lt;p&gt;Output file names follow the pattern: &lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;8-character-hash&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;nodename&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]-[&lt;/code&gt;&lt;em&gt;&lt;code&gt;thread-id&lt;/code&gt;&lt;/em&gt;&lt;code&gt;].parquet&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Column names in partition directories are lowercase.&lt;/p&gt;
&lt;p&gt;Files exported to a local file system by any Vertica user are owned by the Vertica superuser. Files exported to HDFS or object stores are owned by the Vertica user who exported the data.&lt;/p&gt;
&lt;p&gt;Making concurrent exports to the same output destination is an error and can produce incorrect results.&lt;/p&gt;
&lt;p&gt;Exports to the local file system can be to an NFS mount (shared) or to the Linux file system on each node (non-shared). For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-linux-file-system/&#34;&gt;Exporting to the Linux file system&lt;/a&gt;. Exports to non-shared local file systems have the following restrictions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The output directory must not exist on any node.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have a USER storage location or superuser privileges.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You cannot override the permissions mode of 700 for directories and 600 for files.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Exports to object-store file systems are not atomic. Be careful to wait for the export to finish before using the data. For details, see &lt;a href=&#34;../../../en/data-export/file-export/exporting-to-object-stores/&#34;&gt;Exporting to object stores&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example demonstrates exporting all columns from theT1 table in the public schema, using GZIP compression.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO PARQUET(directory=&amp;#39;webhdfs:///user1/data&amp;#39;, compression=&amp;#39;gzip&amp;#39;)
  AS SELECT * FROM public.T1;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example demonstrates exporting the results of a query using more than one table.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO PARQUET(directory=&amp;#39;s3://DataLake/sales_by_region&amp;#39;)
   AS SELECT sale.price, sale.date, store.region
   FROM public.sales sale
   JOIN public.vendor store ON sale.distribID = store.ID;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example demonstrates partitioning and exporting data. EXPORT TO PARQUET first partitions the data on region and then, within each partition, sorts by store.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO PARQUET(directory=&amp;#39;gs://DataLake/user2/data&amp;#39;)
  OVER(PARTITION BY store.region ORDER BY store.ID)
  AS SELECT sale.price, sale.date, store.ID
  FROM public.sales sale
  JOIN public.vendor store ON sale.distribID = store.ID;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example uses an alias column label for a selected column target that is an expression.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO PARQUET(directory=&amp;#39;webhdfs:///user3/data&amp;#39;)
  OVER(ORDER BY col1) AS SELECT col1 + col1 AS A, col2
  FROM public.T3;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example sets permissions for the output.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPORT TO PARQUET(directory=&amp;#39;webhdfs:///user1/data&amp;#39;,
     fileMode=&amp;#39;432&amp;#39;, dirMode=&amp;#39;rwxrw-r-x&amp;#39;)
  AS SELECT * FROM public.T1;
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPORT TO VERTICA</title>
      <link>/en/sql-reference/statements/export-to/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/export-to/</guid>
      <description>
        
        
        &lt;p&gt;Exports table data from one Vertica database to another.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The source database must be no more than one major release behind the target database.
&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EXPORT [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label‑string&lt;/span&gt;)*/ ] TO VERTICA
   &lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.[&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;target‑table&lt;/span&gt; [ ( &lt;span class=&#34;code-variable&#34;&gt;target‑columns&lt;/span&gt; ) ]
   { AS SELECT &lt;span class=&#34;code-variable&#34;&gt;query‑expression&lt;/span&gt; | FROM [&lt;span class=&#34;code-variable&#34;&gt;&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;source‑table&lt;/span&gt;[ ( &lt;span class=&#34;code-variable&#34;&gt;source‑columns&lt;/span&gt; ) ] }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The target database of the data to export. A connection to this database must already exist in the current session before starting the copy operation; otherwise Vertica returns an error. For details, see &lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/connect-to/&#34;&gt;CONNECT TO VERTICA&lt;/a&gt;&lt;/span&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema.&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;&lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table in &lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt; to store the exported data. The table cannot have columns of &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/&#34;&gt;complex data types&lt;/a&gt; other than native arrays.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;target‑columns&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of columns in &lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt; in which to store the exported data.See &lt;a href=&#34;#Mapping&#34;&gt;Mapping Between Source and Target Columns&lt;/a&gt;, below.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;query‑expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The data to export.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema.&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;&lt;em&gt;&lt;code&gt;source‑table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table that contains the data to export.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;source‑columns&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of the columns in the source table to export. The table cannot have columns of complex data types.See &lt;a href=&#34;#Mapping&#34;&gt;Mapping Between Source and Target Columns&lt;/a&gt;, below.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Source table: SELECT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Source table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Target table: INSERT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Target table schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a name=&#34;Mapping&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;mapping-between-source-and-target-columns&#34;&gt;Mapping between source and target columns&lt;/h2&gt;
&lt;p&gt;If you export all table data from one database to another, &lt;span class=&#34;sql&#34;&gt;EXPORT TO VERTICA&lt;/span&gt; can omit specifying column lists if column definitions in both tables comply with the following conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Same number of columns&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Identical column names&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Same sequence of columns&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Matching or &lt;a href=&#34;../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt; column data types&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;No complex data types (ARRAY, SET, or ROW), except for native arrays&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If any of these conditions is not true, the &lt;span class=&#34;sql&#34;&gt;EXPORT TO VERTICA&lt;/span&gt; statement must include column lists that explicitly map source and target columns to each other, as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Contain the same number of columns.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;List source and target columns in the same order.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pair columns with the same (or &lt;a href=&#34;../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt;) data types.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/data-export/db-export-and-import/exporting-data-to-another-db/&#34;&gt;Exporting data to another database&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/data-export/db-export-and-import/handling-node-failure-during-copyexport/&#34;&gt;Handling node failure during copy/export&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/copy-from/&#34;&gt;COPY FROM VERTICA&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GET DIRECTED QUERY</title>
      <link>/en/sql-reference/statements/get-directed-query/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/get-directed-query/</guid>
      <description>
        
        
        &lt;p&gt;Queries system table &lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/directed-queries/&#34;&gt;DIRECTED_QUERIES&lt;/a&gt; on the specified input query, and returns details of all directed queries that map to the input query. For details about output, see &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/managing-directed-queries/getting-directed-queries/&#34;&gt;Getting directed queries&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GET DIRECTED QUERY &lt;span class=&#34;code-variable&#34;&gt;input-query&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;input-query&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;An input query that is associated with one or more directed queries.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/managing-directed-queries/getting-directed-queries/&#34;&gt;Getting directed queries&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GRANT statements</title>
      <link>/en/sql-reference/statements/grant-statements/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/grant-statements/</guid>
      <description>
        
        
        &lt;p&gt;GRANT statements grant privileges on database objects to &lt;a href=&#34;../../../en/admin/db-users-and-privileges/db-users/&#34;&gt;users&lt;/a&gt; and &lt;a href=&#34;../../../en/admin/db-users-and-privileges/db-roles/&#34;&gt;roles&lt;/a&gt;.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
In a database with trust authentication, GRANT statements appear to work as expected but have no real effect on database security.
&lt;/div&gt;&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: INSERT</title>
      <link>/en/sql-reference/statements/insert/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/insert/</guid>
      <description>
        
        
        &lt;p&gt;Inserts values into all projections of the specified table. You must insert one complete tuple at a time. If no projections are associated with the target table, Vertica creates a superprojection to store the inserted values.&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;INSERT&lt;/span&gt; works for flex tables as well as regular native tables. If the table has real columns, inserted data of scalar types and native arrays of scalar types is added to both the real column and the &lt;code&gt;__raw__&lt;/code&gt; column. For data of &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/&#34;&gt;complex types&lt;/a&gt;, the values are not added to the &lt;code&gt;__raw__&lt;/code&gt; column.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INSERT [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label‑string&lt;/span&gt;)*/ ] INTO [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table-name &lt;/span&gt;
    [ ( &lt;span class=&#34;code-variable&#34;&gt;column-list&lt;/span&gt; ) ]
    { DEFAULT VALUES | VALUES ( &lt;span class=&#34;code-variable&#34;&gt;values-list&lt;/span&gt; )[,...] | &lt;a href=&#34;../../../en/sql-reference/statements/select/&#34;&gt;SELECT {{&amp;lt; codevar &amp;gt;}}query-expression{{&amp;lt; /codevar &amp;gt;}}&lt;/a&gt; }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table‑name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The target table. You cannot invoke &lt;span class=&#34;sql&#34;&gt;INSERT&lt;/span&gt; on a projection.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;column‑list&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of one or more target columns in this table, listed in any order. &lt;span class=&#34;sql&#34;&gt;VALUES&lt;/span&gt; clause values are mapped to columns in the same order. If you omit this list, Vertica maps &lt;span class=&#34;sql&#34;&gt;VALUES&lt;/span&gt; clause values to columns according to column order in the table definition.
&lt;p&gt;A list of target columns is invalid with &lt;span class=&#34;sql&#34;&gt;DEFAULT VALUES&lt;/span&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;DEFAULT VALUES&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Fills all columns with their default values as specified in the table definition. If no default value is specified for a column, Vertica inserts a &lt;span class=&#34;sql&#34;&gt;NULL&lt;/span&gt; value.
&lt;p&gt;You cannot specify a list of target columns with this option.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VALUES (&lt;/code&gt;&lt;em&gt;&lt;code&gt;values‑list&lt;/code&gt;&lt;/em&gt;&lt;code&gt;)&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of one or more values to insert in the target columns, where each value is one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; resolves to a value to insert in the target column. The expression must not nest other expressions, include Vertica meta-functions, or use mixed complex types. Values may include native array or ROW types if Vertica can coerce the element or field types.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;DEFAULT&lt;/span&gt; inserts the default value as specified in the table definition.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If no value is supplied for a column, Vertica implicitly adds a &lt;span class=&#34;sql&#34;&gt;DEFAULT&lt;/span&gt; value, if defined. Otherwise Vertica inserts a &lt;span class=&#34;sql&#34;&gt;NULL&lt;/span&gt; value. If the column is defined as &lt;span class=&#34;sql&#34;&gt;NOT NULL&lt;/span&gt;, &lt;span class=&#34;sql&#34;&gt;INSERT&lt;/span&gt; returns an error.&lt;/p&gt;
&lt;p&gt;You can use INSERT to insert multiple rows in the target table, by specifying multiple comma-delimited VALUES lists:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INSERT INTO &lt;span class=&#34;code-variable&#34;&gt;table-name&lt;/span&gt;
   VALUES ( &lt;span class=&#34;code-variable&#34;&gt;values-list&lt;/span&gt; ), ( &lt;span class=&#34;code-variable&#34;&gt;values-list&lt;/span&gt; )[,...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For details, see &lt;a href=&#34;#Multi-Ro&#34;&gt;Multi-Row INSERT&lt;/a&gt; below.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;a name=&#34;InsertSelect&#34;&gt;&lt;/a&gt;&lt;code&gt;SELECT &lt;/code&gt;&lt;em&gt;&lt;code&gt;query‑expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A query that returns the rows to insert. Isolation level applies only to the &lt;span class=&#34;sql&#34;&gt;SELECT&lt;/span&gt; clauses and works like any query. Restrictions on use of &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/&#34;&gt;complex types&lt;/a&gt; apply as in other queries.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Table owner or user with GRANT OPTION is grantor&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;INSERT privilege on table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on schema that contains the table&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;committing-successive-table-changes&#34;&gt;Committing successive table changes&lt;/h2&gt;
&lt;p&gt;Vertica follows the SQL-92 transaction model, so successive INSERT, UPDATE, and DELETE statements are included in the same transaction. You do not need to explicitly start this transaction; however, you must explicitly end it with &lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt;, or implicitly end it with &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt;. Otherwise, Vertica discards all changes that were made within the transaction.&lt;/p&gt;

&lt;p&gt;&lt;a name=&#34;Multi-Ro&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;multi-row-insert&#34;&gt;Multi-row INSERT&lt;/h2&gt;
&lt;p&gt;You can use INSERT to insert multiple rows in the target table, by specifying multiple comma-delimited VALUES lists. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE public.t1(a int, b int, c varchar(16));
CREATE TABLE
=&amp;gt; INSERT INTO t1 VALUES (1,2, &amp;#39;un, deux&amp;#39;), (3,4, &amp;#39;trois, quatre&amp;#39;);
 OUTPUT
--------
      2
(1 row)

=&amp;gt; COMMIT;
COMMIT
=&amp;gt; SELECT * FROM t1;
 a | b |       c
---+---+---------------
 1 | 2 | un, deux
 3 | 4 | trois, quatre
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Vertica does not support subqueries as the target of an &lt;span class=&#34;sql&#34;&gt;INSERT&lt;/span&gt; statement.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restrictions on the use of &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/&#34;&gt;complex types&lt;/a&gt; in &lt;span class=&#34;sql&#34;&gt;SELECT&lt;/span&gt; statements apply equally to &lt;span class=&#34;sql&#34;&gt;INSERT&lt;/span&gt;. Using complex values that cannot be coerced to the column type results in an error.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If primary key, unique key, or check constraints are enabled for automatic enforcement in the target table, Vertica enforces those constraints when you load new data. If a violation occurs, Vertica rolls back the operation and returns an error.&lt;/p&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If an insert would violate a table or schema disk quota, the operation fails. For more information, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/disk-quotas/&#34;&gt;Disk quotas&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; INSERT INTO t1 VALUES (101, 102, 103, 104);
=&amp;gt; INSERT INTO customer VALUES (10, &amp;#39;male&amp;#39;, &amp;#39;DPR&amp;#39;, &amp;#39;MA&amp;#39;, 35);
=&amp;gt; INSERT INTO start_time VALUES (12, &amp;#39;film&amp;#39;,&amp;#39;05:10:00:01&amp;#39;);
=&amp;gt; INSERT INTO retail.t1 (C0, C1) VALUES (1, 1001);
=&amp;gt; INSERT INTO films SELECT * FROM tmp_films WHERE date_prod &amp;lt; &amp;#39;2004-05-07&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Vertica does not support subqueries or nested expressions as the target of an &lt;span class=&#34;sql&#34;&gt;INSERT&lt;/span&gt; statement. For example, the following query returns an error message:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; INSERT INTO t1 (col1, col2) VALUES (&amp;#39;abc&amp;#39;, (SELECT mycolumn FROM mytable));
ERROR 4821:  Subqueries not allowed in target of insert
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can rewrite the above query as follows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; INSERT INTO t1 (col1, col2) (SELECT &amp;#39;abc&amp;#39;, mycolumn FROM mytable);
 OUTPUT
--------
      0
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example shows how to use &lt;span class=&#34;sql&#34;&gt;INSERT...VALUES&lt;/span&gt; with flex tables:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE FLEX TABLE flex1();
 CREATE TABLE
=&amp;gt; INSERT INTO flex1(a,b) VALUES (1, &amp;#39;x&amp;#39;);
 OUTPUT
--------
      1
(1 row)

=&amp;gt; SELECT MapToString(__raw__) FROM flex1;
           MapToString
---------------------------------
{
&amp;#34;a&amp;#34; : &amp;#34;1&amp;#34;,
&amp;#34;b&amp;#34; : &amp;#34;x&amp;#34;
}
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example shows how to use &lt;span class=&#34;sql&#34;&gt;INSERT...SELECT&lt;/span&gt; with flex tables:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE FLEX TABLE flex2();
 CREATE TABLE
=&amp;gt; INSERT INTO flex2(a, b) SELECT a, b, &amp;#39;2016-08-10 11:10&amp;#39; c, &amp;#39;Hello&amp;#39; d, 3.1415 e, f from flex1;
 OUTPUT
--------
      1
(1 row)

=&amp;gt; SELECT MapToString(__raw__) FROM flex2;
           MapToString
---------------------------------
{
&amp;#34;a&amp;#34; : &amp;#34;1&amp;#34;,
&amp;#34;b&amp;#34; : &amp;#34;x&amp;#34;,
&amp;#34;c&amp;#34; : &amp;#34;2016-08-10&amp;#34;,
&amp;#34;d&amp;#34; : &amp;#34;Hello&amp;#34;,
&amp;#34;e&amp;#34; : 3.1415,
&amp;#34;f&amp;#34; : null
}
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following examples use complex types:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE inventory(storeID INT, product ROW(name VARCHAR, code VARCHAR));
CREATE TABLE

--- LookUpProducts() returns a row(varchar, int), which is cast to row(varchar, varchar):
=&amp;gt; INSERT INTO inventory(product) SELECT LookUpProducts();
 OUTPUT
--------
      5
(1 row)

--- Cannot use with select...values:
=&amp;gt; INSERT INTO inventory(product) VALUES(LookUpProducts());
ERROR 2631:  Column &amp;#34;product&amp;#34; is of type &amp;#34;row(varchar,varchar)&amp;#34; but expression is of type &amp;#34;row(varchar,int)&amp;#34;

--- Literal values are supported:
=&amp;gt; INSERT INTO inventory(product) VALUES(ROW(&amp;#39;xbox&amp;#39;,165));
 OUTPUT
--------
      1
(1 row)

=&amp;gt; SELECT product FROM inventory;
          product
------------------------------
 {&amp;#34;name&amp;#34;:&amp;#34;xbox&amp;#34;,&amp;#34;code&amp;#34;:&amp;#34;125&amp;#34;}
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LOCK TABLE</title>
      <link>/en/sql-reference/statements/lock-table/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/lock-table/</guid>
      <description>
        
        
        &lt;p&gt;&lt;a href=&#34;../../../en/admin/db-locks/&#34;&gt;Locks&lt;/a&gt; a table, giving the caller&#39;s session &lt;a href=&#34;../../../en/admin/db-locks/lock-modes/&#34;&gt;exclusive access&lt;/a&gt; to certain operations. Tables are automatically unlocked after the current transaction ends—that is, after &lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt; or &lt;a href=&#34;../../../en/sql-reference/statements/rollback/&#34;&gt;ROLLBACK&lt;/a&gt;. LOCK TABLE can be useful for &lt;a href=&#34;../../../en/admin/db-locks/deadlocks/&#34;&gt;preventing deadlocks&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To view existing locks, see &lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/locks/&#34;&gt;LOCKS&lt;/a&gt;.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;&lt;a href=&#34;../../../en/admin/transactions/read-committed-isolation/&#34;&gt;READ COMMITTED isolation&lt;/a&gt; (default) and &lt;a href=&#34;../../../en/admin/transactions/serializable-isolation/&#34;&gt;SERIALIZABLE isolation&lt;/a&gt; automatically handle locks for you, and the vast majority of users can rely on them exclusively; LOCK TABLE is only for advanced users who need granular control over locks for more complex workloads.&lt;/p&gt;
&lt;p&gt;To implement pessimistic concurrency without manually locking tables, you can use &lt;a href=&#34;../../../en/sql-reference/statements/select/&#34;&gt;SELECT...FOR UPDATE&lt;/a&gt; to acquire an EXCLUSIVE (X) lock on the table.&lt;/p&gt;


&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LOCK [ TABLE ] [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.] &lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt; [,...]
    IN { &lt;span class=&#34;code-variable&#34;&gt;lock_type&lt;/span&gt; } MODE
    [ NOWAIT ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table to lock.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;lock‑type&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;a href=&#34;../../../en/admin/db-locks/lock-modes/&#34;&gt;type of lock&lt;/a&gt;, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;SHARE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;INSERT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;INSERT VALIDATE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;SHARE INSERT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;EXCLUSIVE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;NOT DELETE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;OWNER&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

LOCK TABLE does not currently support D (drop partition) locks.

&lt;/div&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;NOWAIT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;If specified, LOCK TABLE returns and reports an error immediately if it cannot acquire the lock. Otherwise, LOCK TABLE waits for incompatible locks to be released by their respective sessions, returning an error if the lock is not released after a certain amount of time, as defined by &lt;a href=&#34;../../../en/sql-reference/config-parameters/general-parameters/&#34;&gt;LockTimeout&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Required &lt;a href=&#34;../../../en/sql-reference/statements/grant-statements/grant-table/&#34;&gt;privileges&lt;/a&gt; depend on the type of lock requested:

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Lock&lt;/th&gt; 

&lt;th &gt;
Privileges&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
SHARED (S)&lt;/td&gt; 

&lt;td &gt;
SELECT&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
INSERT (I)&lt;/td&gt; 

&lt;td &gt;
INSERT&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
SHARE INSERT&lt;/td&gt; 

&lt;td &gt;
SELECT, INSERT&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
INSERT VALIDATE (IV)&lt;/td&gt; 

&lt;td &gt;
SELECT, INSERT&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
EXCLUSIVE (X)&lt;/td&gt; 

&lt;td &gt;
UPDATE, DELETE&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
NOT DELETE (T)&lt;/td&gt; 

&lt;td &gt;
SELECT&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
USAGE&lt;/td&gt; 

&lt;td &gt;
All privileges&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Owner&lt;/td&gt; 

&lt;td &gt;
All privileges&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/db-locks/lock-examples/&#34;&gt;Lock examples&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: MERGE</title>
      <link>/en/sql-reference/statements/merge/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/merge/</guid>
      <description>
        
        
        &lt;p&gt;Performs update and insert operations on a target table based on the results of a join with another data set, such as a table or view. The join can match a source row with only one target row; otherwise, Vertica returns an error.&lt;/p&gt;
&lt;p&gt;If a merge would violate a table or schema disk quota, the operation fails. For more information, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/disk-quotas/&#34;&gt;Disk quotas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The target table cannot have columns of complex data types. The source table can, so long as those columns are not included in the merge operation.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MERGE [ /*+LABEL (&lt;span class=&#34;code-variable&#34;&gt;label‑string&lt;/span&gt;)*/ ]
    INTO [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;target‑table&lt;/span&gt; [ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias &lt;/span&gt;]
    USING &lt;span class=&#34;code-variable&#34;&gt;source‑dataset&lt;/span&gt;
    ON  &lt;span class=&#34;code-variable&#34;&gt;join-condition&lt;/span&gt; &lt;span class=&#34;code-variable&#34;&gt;matching‑clause&lt;/span&gt;[ &lt;span class=&#34;code-variable&#34;&gt;matching‑clause&lt;/span&gt; ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;p&gt;Number of target table rows updated or inserted&lt;/p&gt;
&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Assigns a label to a statement to identify it for profiling and debugging.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table on which to perform update and insert operations. &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; takes an X (exclusive) lock on the target table during the operation. The table must not contain columns of complex types.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The total number of target table columns cannot exceed 831.
&lt;/div&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;source‑dataset&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The data to join to &lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt;, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;[[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema.&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[ [AS]&lt;/code&gt;&lt;em&gt;&lt;code&gt;alias&lt;/code&gt;&lt;/em&gt;&lt;code&gt; ]&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;[[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema.&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;&lt;em&gt;&lt;code&gt;view&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[ [AS]&lt;/code&gt;&lt;em&gt;&lt;code&gt;alias&lt;/code&gt;&lt;/em&gt;&lt;code&gt; ]&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;(&lt;/code&gt;&lt;em&gt;&lt;code&gt;subquery&lt;/code&gt;&lt;/em&gt;&lt;code&gt;) &lt;/code&gt;&lt;em&gt;&lt;code&gt;sq-alias&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The specified data set typically supplies the data used to update the target table and populate new rows. You can specify an external table.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ON &lt;/code&gt;&lt;em&gt;&lt;code&gt;join‑condition&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The conditions on which to join the target table and source data set.

&lt;div class=&#34;alert admonition tip&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Tip&lt;/h4&gt;

The Vertica query optimizer can create an optimized query plan for a &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; statement only if the target table join column has a unique or primary key constraint. For details, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/merge-optimization/&#34;&gt;MERGE optimization&lt;/a&gt;.

&lt;/div&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;matching‑clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;One of the following clauses:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;#WhenMatched&#34;&gt;WHEN MATCHED THEN UPDATE&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;#WhenNotMatched&#34;&gt;WHEN NOT MATCHED THEN INSERT&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; supports one instance of each clause, and must include at least one.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a name=&#34;WhenMatched&#34;&gt;&lt;/a&gt;WHEN MATCHED THEN UPDATE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;For each &lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt; row that is joined (matched) to &lt;em&gt;&lt;code&gt;source‑dataset&lt;/code&gt;&lt;/em&gt;, specifies to update one or more columns:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;WHEN MATCHED [ AND &lt;span class=&#34;code-variable&#34;&gt;update-filter&lt;/span&gt; ] THEN UPDATE
  SET { &lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt; = &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; }[,...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;&lt;code&gt;update-filter&lt;/code&gt;&lt;/em&gt; optionally filters the set of matching rows. The update filter can specify any number of conditions. Vertica evaluates each matching row against this filter, and updates only the rows that evaluate to true. For details, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/update-and-insert-filters/&#34;&gt;Update and insert filters&lt;/a&gt;.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;Vertica also supports Oracle syntax for specifying update filters:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;WHEN MATCHED THEN UPDATE
  SET { &amp;lt;span class=&amp;#34;code-variable&amp;#34;&amp;gt;column&amp;lt;/span&amp;gt; = &amp;lt;span class=&amp;#34;code-variable&amp;#34;&amp;gt;expression&amp;lt;/span&amp;gt; }[,...]
  [ WHERE &amp;lt;span class=&amp;#34;code-variable&amp;#34;&amp;gt;update‑filter &amp;lt;/span&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The following requirements apply:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; statement can contain only one &lt;span class=&#34;sql&#34;&gt;WHEN MATCHED&lt;/span&gt; clause.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;target‑column&lt;/code&gt;&lt;/em&gt; can only specify a column name in the target table. It cannot be qualified with a table name.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/&#34;&gt;Merging table data&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a name=&#34;WhenNotMatched&#34;&gt;&lt;/a&gt;WHEN NOT MATCHED THEN INSERT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;For each &lt;em&gt;&lt;code&gt;source‑dataset&lt;/code&gt;&lt;/em&gt; row that is not joined (not matched) to &lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt;, specifies to:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Insert a new row into &lt;em&gt;&lt;code&gt;target‑table&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Populate each new row with the values specified in &lt;em&gt;&lt;code&gt;values‑list&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;WHEN NOT MATCHED [ AND &lt;span class=&#34;code-variable&#34;&gt;insert-filter&lt;/span&gt; ] THEN INSERT
  [ ( &lt;span class=&#34;code-variable&#34;&gt;column‑list&lt;/span&gt; ) ] VALUES ( &lt;span class=&#34;code-variable&#34;&gt;values‑list&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;&lt;code&gt;column‑list&lt;/code&gt;&lt;/em&gt; is a comma-delimited list of one or more target columns in the target table, listed in any order. &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; maps &lt;em&gt;&lt;code&gt;column‑list&lt;/code&gt;&lt;/em&gt; columns to &lt;em&gt;&lt;code&gt;values‑list&lt;/code&gt;&lt;/em&gt; values in the same order, and each column-value pair must be &lt;a href=&#34;../../../en/sql-reference/data-types/data-type-coercion/&#34;&gt;compatible&lt;/a&gt;. If you omit &lt;em&gt;&lt;code&gt;column‑list&lt;/code&gt;&lt;/em&gt;, Vertica maps &lt;em&gt;&lt;code&gt;values‑list&lt;/code&gt;&lt;/em&gt; values to columns according to column order in the table definition.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;insert-filter&lt;/code&gt;&lt;/em&gt; optionally filters the set of non-matching rows. The insert filter can specify any number of conditions. Vertica evaluates each non-matching source row against this filter. For each row that evaluates to true, Vertica inserts a new row in the target table. For details, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/update-and-insert-filters/&#34;&gt;Update and insert filters&lt;/a&gt;.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;Vertica also supports Oracle syntax for specifying insert filters:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;WHEN NOT MATCHED THEN INSERT
  [ ( &amp;lt;span class=&amp;#34;code-variable&amp;#34;&amp;gt;column‑list&amp;lt;/span&amp;gt; ) ] VALUES ( &amp;lt;span class=&amp;#34;code-variable&amp;#34;&amp;gt;values‑list&amp;lt;/span&amp;gt;
  [ WHERE &amp;lt;span class=&amp;#34;code-variable&amp;#34;&amp;gt;insert‑filter &amp;lt;/span&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The following requirements apply:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; statement can contain only one &lt;span class=&#34;sql&#34;&gt;WHEN NOT MATCHED&lt;/span&gt; clause.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;*&lt;/code&gt;column‑list&lt;code&gt;*&lt;/code&gt;&lt;/em&gt; can only specify column names in the target table. It cannot be qualified with a table name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Insert filter conditions can only reference the source data. If any condition references the target table, Vertica returns an error.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/&#34;&gt;Merging table data&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; requires the following privileges:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;SELECT&lt;/span&gt; permissions on the source data and &lt;span class=&#34;sql&#34;&gt;INSERT&lt;/span&gt;, &lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt;, and &lt;span class=&#34;sql&#34;&gt;DELETE&lt;/span&gt; permissions on the target table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Automatic constraint enforcement requires &lt;span class=&#34;sql&#34;&gt;SELECT&lt;/span&gt; permissions on the table containing the constraint.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;SELECT&lt;/span&gt; permissions on the target table if the condition in the syntax reads data from the target table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, the following &lt;span class=&#34;sql&#34;&gt;GRANT&lt;/span&gt; statement grants &lt;code&gt;user1&lt;/code&gt; access to the &lt;code&gt;t2&lt;/code&gt; table. This allows &lt;code&gt;user1&lt;/code&gt; to run the &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; statement that follows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE t2 to user1;
GRANT PRIVILEGE

=&amp;gt;\c - user1
You are now connected as user &amp;#34;user1&amp;#34;.

=&amp;gt; MERGE INTO t2 USING t1 ON t1.a = t2.a
WHEN MATCHED THEN UPDATE SET b = t1.b
WHEN NOT MATCHED THEN INSERT (a, b) VALUES (t1.a, t1.b);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a name=&#34;WhenMatched&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;a-nameupdateinsertfiltersaimproving-merge-performance&#34;&gt;&lt;a name=&#34;UpdateInsertFilters&#34;&gt;&lt;/a&gt;Improving MERGE performance&lt;/h2&gt;
&lt;p&gt;You can improve &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; performance in several ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/merge-optimization/#Projecti&#34;&gt;Design projections for optimal MERGE performance&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/merge-optimization/#Requirem&#34;&gt;Facilitate creation of optimized query plans&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use a source data set that is smaller than the target table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/merge-optimization/&#34;&gt;MERGE optimization&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;constraint-enforcement&#34;&gt;Constraint enforcement&lt;/h2&gt;
&lt;p&gt;If primary key, unique key, or check constraints are enabled for automatic enforcement in the target table, Vertica enforces those constraints when you load new data. If a violation occurs, Vertica rolls back the operation and returns an error.

&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;

If you run &lt;span class=&#34;sql&#34;&gt;MERGE&lt;/span&gt; multiple times using the same target and source table, each iteration is liable to introduce duplicate values into the target columns and return with an error.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;columns-prohibited-from-merge&#34;&gt;Columns prohibited from merge&lt;/h2&gt;
&lt;p&gt;The following columns cannot be specified in a merge operation; attempts to do so return with an error:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/admin/working-with-native-tables/sequences/identity-sequences/&#34;&gt;IDENTITY&lt;/a&gt; columns, or columns whose default value is set to a &lt;a href=&#34;../../../en/admin/working-with-native-tables/sequences/named-sequences/creating-and-using-named-sequences/&#34;&gt;named sequence&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vmap columns such as &lt;code&gt;__raw__&lt;/code&gt; in flex tables.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Columns of complex types ARRAY, SET, or ROW.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/basic-merge-example/&#34;&gt;Basic MERGE example&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/merge-source-options/&#34;&gt;MERGE source options&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/merge-matching-clauses/&#34;&gt;MERGE matching clauses&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/update-and-insert-filters/&#34;&gt;Update and insert filters&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../en/admin/working-with-native-tables/merging-table-data/&#34;&gt;Merging table data&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: PROFILE</title>
      <link>/en/sql-reference/statements/profile/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/profile/</guid>
      <description>
        
        
        &lt;p&gt;Profiles a single SQL statement.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PROFILE { &lt;span class=&#34;code-variable&#34;&gt;sql-statement&lt;/span&gt; }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;sql‑statement&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A query (&lt;code&gt;SELECT&lt;/code&gt;) statement or DML statement--for example, you can profile 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/insert/&#34;&gt;INSERT&lt;/a&gt;&lt;/code&gt;, 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/update/&#34;&gt;UPDATE&lt;/a&gt;&lt;/code&gt;, 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt;&lt;/code&gt;, and 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/statements/merge/&#34;&gt;MERGE&lt;/a&gt;&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;output&#34;&gt;Output&lt;/h2&gt;
&lt;p&gt;Writes profile summary to stderr, saves details to system catalog 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/execution-engine-profiles/&#34;&gt;V_MONITOR.EXECUTION_ENGINE_PROFILES&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;The same privileges required to run the profiled statement&lt;/p&gt;
&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;PROFILE&lt;/code&gt; generates detailed information about how the target statement executes, and saves that information in the system catalog 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/execution-engine-profiles/&#34;&gt;V_MONITOR.EXECUTION_ENGINE_PROFILES&lt;/a&gt;&lt;/code&gt;. Query output is preceded by a profile summary: profile identifiers &lt;code&gt;transaction_id&lt;/code&gt; and &lt;code&gt;statement_id&lt;/code&gt;, initiator memory for the query, and total memory required. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; PROFILE SELECT customer_name, annual_income FROM public.customer_dimension WHERE (customer_gender, annual_income) IN (SELECT customer_gender, MAX(annual_income) FROM public.customer_dimension GROUP BY customer_gender);
NOTICE 4788:  Statement is being profiled
HINT:  Select * from v_monitor.execution_engine_profiles where transaction_id=45035996274683334 and statement_id=7;
NOTICE 3557:  Initiator memory for query: [on pool general: 708421 KB, minimum: 554324 KB]
NOTICE 5077:  Total memory required by query: [708421 KB]
  customer_name   | annual_income
------------------+---------------
 Emily G. Vogel   |        999998
 James M. McNulty |        999979
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Use profile identifiers to query the table for profile information on a given query.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../en/admin/profiling-db-performance/profiling-single-statements/&#34;&gt;Profiling single statements&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: RELEASE SAVEPOINT</title>
      <link>/en/sql-reference/statements/release-savepoint/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/release-savepoint/</guid>
      <description>
        
        
        &lt;p&gt;Destroys a savepoint without undoing the effects of commands executed after the savepoint was established.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RELEASE [ SAVEPOINT ] &lt;span class=&#34;code-variable&#34;&gt;savepoint_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;savepoint_name&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the name of the savepoint to destroy.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Once destroyed, the savepoint is unavailable as a rollback point.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example establishes and then destroys a savepoint called my_savepoint. The values 101 and 102 are both inserted at commit.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; INSERT INTO product_key VALUES (101);
=&amp;gt; SAVEPOINT my_savepoint;
=&amp;gt; INSERT INTO product_key VALUES (102);
=&amp;gt; RELEASE SAVEPOINT my_savepoint;
=&amp;gt; COMMIT;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/savepoint/&#34;&gt;SAVEPOINT&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/rollback-to-savepoint/&#34;&gt;ROLLBACK TO SAVEPOINT&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REVOKE statements</title>
      <link>/en/sql-reference/statements/revoke-statements/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/revoke-statements/</guid>
      <description>
        
        
        &lt;p&gt;REVOKE statements let you revoke privileges on database objects from &lt;a href=&#34;../../../en/admin/db-users-and-privileges/db-users/&#34;&gt;users&lt;/a&gt; and &lt;a href=&#34;../../../en/admin/db-users-and-privileges/db-roles/&#34;&gt;roles&lt;/a&gt;.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
In a database with trust authentication, REVOKE statements appear to work as expected but have no real effect on database security.
&lt;/div&gt;&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: ROLLBACK</title>
      <link>/en/sql-reference/statements/rollback/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/rollback/</guid>
      <description>
        
        
        &lt;p&gt;Ends the current transaction and discards all changes that occurred during the transaction.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ROLLBACK [ WORK | TRANSACTION ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;WORK | TRANSACTION &lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Have no effect; they are optional keywords for readability.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;When an operation is rolled back, any locks that are acquired by the operation are also rolled back.&lt;/p&gt;
&lt;p&gt;ABORT is a synonym for ROLLBACK.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;This example shows how to roll back from a DELETE transaction.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM sample_table;
a
---
1
(1 row)

=&amp;gt; DELETE FROM sample_table WHERE a = 1;

=&amp;gt; SELECT * FROM sample_table;
a
---
(0 rows)
=&amp;gt; ROLLBACK;
=&amp;gt; SELECT * FROM sample_table;
a
---
1
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This example shows how to roll back the changes you made since the BEGIN statement.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED READ ONLY;
BEGIN
=&amp;gt; ROLLBACK TRANSACTION;
ROLLBACK
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/transactions/&#34;&gt;Transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/inserting-data-ado-net/creating-and-rolling-back-transactions/&#34;&gt;Creating and rolling back transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/begin/&#34;&gt;BEGIN&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/end/&#34;&gt;END&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/start-transaction/&#34;&gt;START TRANSACTION&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: ROLLBACK TO SAVEPOINT</title>
      <link>/en/sql-reference/statements/rollback-to-savepoint/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/rollback-to-savepoint/</guid>
      <description>
        
        
        &lt;p&gt;Rolls back all commands that have been entered within the transaction since the given savepoint was established.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ROLLBACK TO [SAVEPOINT] &lt;span class=&#34;code-variable&#34;&gt;savepoint_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;savepoint_name&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the name of the savepoint to roll back to.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The savepoint remains valid and can be rolled back to again later if needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When an operation is rolled back, any locks that are acquired by the operation are also rolled back.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ROLLBACK TO SAVEPOINT implicitly destroys all savepoints that were established after the named savepoint.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example rolls back the values 102 and 103 that were entered after the savepoint, &lt;code&gt;my_savepoint&lt;/code&gt;, was established. Only the values 101 and 104 are inserted at commit.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; INSERT INTO product_key VALUES (101);
=&amp;gt; SAVEPOINT my_savepoint;
=&amp;gt; INSERT INTO product_key VALUES (102);
=&amp;gt; INSERT INTO product_key VALUES (103);
=&amp;gt; ROLLBACK TO SAVEPOINT my_savepoint;
=&amp;gt; INSERT INTO product_key VALUES (104);
=&amp;gt; COMMIT;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/release-savepoint/&#34;&gt;RELEASE SAVEPOINT&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/savepoint/&#34;&gt;SAVEPOINT&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SAVE QUERY</title>
      <link>/en/sql-reference/statements/save-query/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/save-query/</guid>
      <description>
        
        
        &lt;p&gt;Saves an input query to associate with a custom directed query.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SAVE QUERY &lt;span class=&#34;code-variable&#34;&gt;input-query&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;input‑query&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The input query to associate with a custom directed query. The input query supports only one optimizer hint, 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/v/&#34;&gt;:v&lt;/a&gt;&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/db-superuser/&#34; title=&#34;&#34;&gt;Superuser&lt;/a&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;p&gt;SAVE QUERY saves the specified input query for use by the next invocation of &lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-directed-query/&#34;&gt;CREATE DIRECTED QUERY CUSTOM&lt;/a&gt;. CREATE DIRECTED QUERY CUSTOM pairs the saved query with its annotated query argument to create a directed query. Both statements must be issued in the same user session.&lt;/p&gt;
&lt;p&gt;The saved query remains available until the one of the following events occurs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The next invocation of CREATE DIRECTED QUERY, whether invoked with CUSTOM or OPTIMIZER.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Another invocation of SAVE QUERY.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The session ends.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;

Vertica associates a saved query with a directed query without checking whether the input and annotated queries are compatible. Be careful to sequence SAVE QUERY and CREATE DIRECTED QUERY CUSTOM so the saved and directed queries are correctly matched.

&lt;/div&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/creating-directed-queries/custom-directed-queries/&#34;&gt;Custom directed queries&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SAVEPOINT</title>
      <link>/en/sql-reference/statements/savepoint/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/savepoint/</guid>
      <description>
        
        
        &lt;p&gt;
Creates a special mark, called a savepoint, inside a transaction. A savepoint allows all commands that are executed after it was established to be rolled back, restoring the transaction to the state it was in at the point in which the savepoint was established.

&lt;div class=&#34;alert admonition tip&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Tip&lt;/h4&gt;

Savepoints are useful when creating nested transactions. For example, a savepoint could be created at the beginning of a subroutine. That way, the result of the subroutine could be rolled back if necessary.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SAVEPOINT &lt;span class=&#34;code-variable&#34;&gt;savepoint_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;savepoint_name&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the name of the savepoint to create.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Savepoints are local to a transaction and can only be established when inside a transaction block.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Multiple savepoints can be defined within a transaction.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If a savepoint with the same name already exists, it is replaced with the new savepoint.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example illustrates how a savepoint determines which values within a transaction can be rolled back. The values 102 and 103 that were entered after the savepoint, &lt;code&gt;my_savepoint&lt;/code&gt;, was established are rolled back. Only the values 101 and 104 are inserted at commit.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; INSERT INTO T1 (product_key) VALUES (101);
=&amp;gt; SAVEPOINT my_savepoint;
=&amp;gt; INSERT INTO T1 (product_key) VALUES (102);
=&amp;gt; INSERT INTO T1 (product_key) VALUES (103);
=&amp;gt; ROLLBACK TO SAVEPOINT my_savepoint;
=&amp;gt; INSERT INTO T1 (product_key) VALUES (104);
=&amp;gt; COMMIT;
=&amp;gt; SELECT product_key FROM T1;
.
.
.
101
104
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/release-savepoint/&#34;&gt;RELEASE SAVEPOINT&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/rollback-to-savepoint/&#34;&gt;ROLLBACK TO SAVEPOINT&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SELECT</title>
      <link>/en/sql-reference/statements/select/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/select/</guid>
      <description>
        
        
        &lt;p&gt;Returns a result set from one or more data sources—&lt;a href=&#34;../../../en/sql-reference/statements/select/from-clause/table-reference/&#34;&gt;tables&lt;/a&gt;, &lt;a href=&#34;../../../en/data-analysis/views/&#34;&gt;views&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/statements/select/from-clause/joined-table/&#34;&gt;joined tables&lt;/a&gt;, and named &lt;a href=&#34;../../../en/data-analysis/queries/subqueries/&#34;&gt;subqueries&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[ AT &lt;span class=&#34;code-variable&#34;&gt;epoch&lt;/span&gt; ] [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/with-clause/&#34;&gt;WITH-clause&lt;/a&gt;&lt;/span&gt; ] SELECT [ ALL | DISTINCT ]
    { * | { &lt;a href=&#34;../../../en/sql-reference/functions/match-and-search-functions/regular-expression-functions/match-columns/&#34;&gt;MATCH_COLUMNS&lt;/a&gt;(&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt;&amp;#39;) | &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;[ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias &lt;/span&gt;] }[,...] }
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/into-table-clause/&#34;&gt;into-table-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/from-clause/&#34;&gt;from-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/where-clause/&#34;&gt;where-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/timeseries-clause/&#34;&gt;time-series-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/group-by-clause/&#34;&gt;group-by-clause&lt;/a&gt;&lt;/span&gt;[,...] ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/having-clause/&#34;&gt;having-clause&lt;/a&gt;&lt;/span&gt;[,...] ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/match-clause/&#34;&gt;match-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/union-clause/&#34;&gt;union-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/intersect-clause/&#34;&gt;intersect-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/except-clause/&#34;&gt;except-clause&lt;/a&gt;&lt;/span&gt; ]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/order-by-clause/&#34;&gt;order-by-clause&lt;/a&gt;&lt;/span&gt; [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/offset-clause/&#34;&gt;offset-clause&lt;/a&gt;&lt;/span&gt; ]]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/limit-clause/&#34;&gt;limit-clause&lt;/a&gt;&lt;/span&gt; ]
    [ FOR UPDATE [ OF &lt;span class=&#34;code-variable&#34;&gt;table-name&lt;/span&gt;[,...] ] ]
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;SELECT statements can also embed various directives, or &lt;em&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/&#34;&gt;hints&lt;/a&gt;&lt;/em&gt;, that let you control how a given query is handled—for example, join hints such as &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/jtype/&#34;&gt;JTYPE&lt;/a&gt;, which enforces the join type (merge or hash join).&lt;/p&gt;
&lt;p&gt;For details on using Vertica hints, see &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/&#34;&gt;Hints&lt;/a&gt;.&lt;/p&gt;


&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;AT &lt;/code&gt;&lt;em&gt;&lt;code&gt;epoch&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Returns data from the specified epoch, where &lt;em&gt;&lt;code&gt;epoch&lt;/code&gt;&lt;/em&gt; is one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;EPOCH LATEST&lt;/span&gt;: Return data up to but not including the current epoch. The result set includes data from the latest committed DML transaction.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;EPOCH &lt;em&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/em&gt;&lt;/span&gt;: Return data up to and including the &lt;em&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/em&gt;-specified epoch.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;TIME &#39;&lt;em&gt;&lt;code&gt;timestamp&lt;/code&gt;&lt;/em&gt;&#39;&lt;/span&gt;: Return data from the &lt;em&gt;&lt;code&gt;timestamp&lt;/code&gt;&lt;/em&gt;-specified epoch.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

These options are ignored if used to query temporary or external tables.

&lt;/div&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/failure-recovery/epochs/&#34;&gt;Epochs&lt;/a&gt; for additional information about how Vertica uses epochs.&lt;/p&gt;

&lt;p&gt;For details, see &lt;a href=&#34;../../../en/data-analysis/queries/historical-queries/&#34;&gt;Historical queries&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ALL | DISTINCT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ALL&lt;/code&gt; (default): Retains duplicate rows in result set or group.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;DISTINCT&lt;/code&gt;: Removes duplicate rows from the result set or group.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
The &lt;code&gt;ALL&lt;/code&gt; or &lt;code&gt;DISTINCT&lt;/code&gt; qualifier must immediately follow the &lt;code&gt;SELECT&lt;/code&gt; keyword. Only one instance of this keyword can appear in the select list.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;*&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Lists all columns in the queried tables.

&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;

Selecting all columns from the queried tables can produce a very large wide set, which can adversely affect performance.

&lt;/div&gt;&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/functions/match-and-search-functions/regular-expression-functions/match-columns/&#34;&gt;MATCH_COLUMNS&lt;/a&gt;(&#39;&lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt;&#39;)&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Returns all columns in the queried tables that match &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[[AS]&lt;/code&gt;&lt;em&gt;&lt;code&gt;alias&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;An expression that typically resolves to column data from the queried tables—for example, names of &lt;a href=&#34;../../../en/sql-reference/language-elements/expressions/column-references/&#34;&gt;columns&lt;/a&gt; that are specified in the FROM clause; also:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/literals/&#34;&gt;Literals&lt;/a&gt; (constants)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/expressions/aggregate-expressions/&#34;&gt;Aggregate expressions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/expressions/case-expressions/&#34;&gt;CASE expressions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/functions/&#34;&gt;SQL functions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Subqueries in the SELECT list&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can optionally assign a temporary alias to each column expression and reference that alias elsewhere in the SELECT statement—for example, in the query predicate or ORDER BY clause. Vertica uses the alias as the column heading in query output.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;FOR UPDATE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies to obtain an X lock on all tables specified in the query, most often used from &lt;code&gt;READ COMMITTED&lt;/code&gt; isolation.
&lt;p&gt;&lt;code&gt;FOR UPDATE&lt;/code&gt; requires update/delete permissions on the queried tables and cannot be issued from a read-only transaction.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;USAGE on the schema&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;SELECT on the table or view&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;As view owner, you can grant other users SELECT privilege on the view only if one of the following is true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You own the view&#39;s base table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You have SELECT...WITH GRANT OPTION privilege on the view&#39;s base table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;When multiple clients run transactions as in the following example query, deadlocks can occur if &lt;code&gt;FOR UPDATE&lt;/code&gt; is not used. Two transactions acquire an S lock, and when both attempt to upgrade to an X lock, they encounter deadlocks:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT balance FROM accounts WHERE account_id=3476 FOR UPDATE;
    ...
=&amp;gt; UPDATE accounts SET balance = balance+10 WHERE account_id=3476;
=&amp;gt; COMMIT;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/locks/&#34;&gt;LOCKS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/functions/analytic-functions/&#34;&gt;Analytic functions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/data-analysis/sql-analytics/&#34;&gt;SQL analytics&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/data-analysis/time-series-analytics/&#34;&gt;Time series analytics&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/select/match-clause/event-series-pattern-matching/&#34;&gt;Event series pattern matching&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/data-analysis/queries/subqueries/&#34;&gt;Subqueries&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/data-analysis/queries/joins/&#34;&gt;Joins&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SET statements</title>
      <link>/en/sql-reference/statements/set-statements/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/set-statements/</guid>
      <description>
        
        
        &lt;p&gt;SET statements let you change how the database operates, such as changing the autocommit settings or the resource pool your session uses.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHOW</title>
      <link>/en/sql-reference/statements/show/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/show/</guid>
      <description>
        
        
        &lt;p&gt;Shows run-time parameters for the current session.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHOW { &lt;span class=&#34;code-variable&#34;&gt;parameter&lt;/span&gt; | ALL }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows all run-time settings.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;AUTOCOMMIT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Returns on/off to indicate whether statements automatically commit their transactions when they complete.&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a name=&#34;AvailableRoles&#34;&gt;&lt;/a&gt;AVAILABLE ROLES&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Lists all &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/role/&#34; title=&#34;A role groups together a set of privileges that can be assigned to a user or another role.&#34;&gt;roles&lt;/a&gt; available to the user.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;DATESTYLE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the current style of date values. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-datestyle/&#34;&gt;SET DATESTYLE&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a name=&#34;EnabledRoles&#34;&gt;&lt;/a&gt;ENABLED ROLES&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the roles enabled for the current session. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-role/&#34;&gt;SET ROLE&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ESCAPE_STRING_WARNING&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Returns on/off to indicate whether warnings are issued when backslash escapes are found in strings. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-escape-string-warning/&#34;&gt;SET ESCAPE_STRING_WARNING&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;GRACEPERIOD&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the session GRACEPERIOD set by &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-graceperiod/&#34;&gt;SET SESSION GRACEPERIOD&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;IDLESESSIONTIMEOUT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows how long the session can remain idle before it times out.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;INTERVALSTYLE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows whether units are output when printing intervals. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-intervalstyle/&#34;&gt;SET INTERVALSTYLE&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;LOCALE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the current locale. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-locale/&#34;&gt;SET LOCALE&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;MEMORYCAP&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the maximum amount of memory that any request use. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-memorycap/&#34;&gt;SET MEMORYCAP&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;MULTIPLEACTIVERESULTSETS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Returns on/off to indicate whether multiple active result sets on one connection are allowed. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-multipleactiveresultsets/&#34;&gt;SET SESSION MULTIPLEACTIVERESULTSETS&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;RESOURCE POOL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the resource pool that the session is using. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-resource-pool/&#34;&gt;SET RESOURCE POOL&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;RUNTIMECAP&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the maximum amount of time that queries can run in the session. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-runtimecap/&#34;&gt;SET RUNTIMECAP&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;SEARCH_PATH&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the order in which Vertica searches schemas. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-search-path/&#34;&gt;SET SEARCH_PATH&lt;/a&gt;. For example:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW SEARCH_PATH;
    name     |                      setting
-------------+---------------------------------------------------
 search_path | &amp;#34;$user&amp;#34;, public, v_catalog, v_monitor, v_internal
(1 row)
  
&lt;/code&gt;&lt;/pre&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;STANDARD_CONFORMING_STRINGS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows whether backslash escapes are enabled for the session. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-standard-conforming-strings/&#34;&gt;SET STANDARD_CONFORMING_STRINGS&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;TEMPSPACECAP&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the maximum amount of temporary file space that queries can use in the session. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-tempspacecap/&#34;&gt;SET TEMPSPACECAP&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;TIMEZONE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the timezone set in the current session. See &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-time-zone/&#34;&gt;SET TIMEZONE&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a name=&#34;ShowTransactionIsolation&#34;&gt;&lt;/a&gt;TRANSACTION_ISOLATION&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows the current transaction isolation setting, as described in &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-characteristics-as-transaction/&#34;&gt;SET SESSION CHARACTERISTICS AS TRANSACTION&lt;/a&gt;. For example:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW TRANSACTION_ISOLATION;
         name          |    setting
-----------------------+----------------
 transaction_isolation | READ COMMITTED
(1 row)
  
&lt;/code&gt;&lt;/pre&gt;&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a name=&#34;ShowTransactionReadOnly&#34;&gt;&lt;/a&gt;TRANSACTION_READ_ONLY&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Returns true/false to indicate the current read-only setting, as described in &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-session-characteristics-as-transaction/&#34;&gt;SET SESSION CHARACTERISTICS AS TRANSACTION&lt;/a&gt;. For example:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW TRANSACTION_READ_ONLY;
         name          | setting
-----------------------+---------
 transaction_read_only | false
(1 row)
  
&lt;/code&gt;&lt;/pre&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Display all current runtime parameter settings:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW ALL;
            name             |                          setting
-----------------------------+-----------------------------------------------------------
 locale                      | en_US@collation=binary (LEN_KBINARY)
 autocommit                  | off
 standard_conforming_strings | on
 escape_string_warning       | on
 multipleactiveresultsets    | off
 datestyle                   | ISO, MDY
 intervalstyle               | plain
 timezone                    | America/New_York
 search_path                 | &amp;#34;$user&amp;#34;, public, v_catalog, v_monitor, v_internal, v_func
 transaction_isolation       | READ COMMITTED
 transaction_read_only       | false
 resource_pool               | general
 memorycap                   | UNLIMITED
 tempspacecap                | UNLIMITED
 runtimecap                  | UNLIMITED
 idlesessiontimeout          | UNLIMITED
 graceperiod                 | UNLIMITED
 enabled roles               | dbduser*, dbadmin*, pseudosuperuser*
 available roles             | dbduser*, dbadmin*, pseudosuperuser*
 (19 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHOW CURRENT</title>
      <link>/en/sql-reference/statements/show-current/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/show-current/</guid>
      <description>
        
        
        &lt;p&gt;Displays active configuration parameter values that are set at all levels. Vertica first checks values set at the session level. If a value is not set for a configuration parameter at the session level, Vertica next checks if the value is set for the node where you are logged in, and then checks the database level. If no values are set, &lt;code&gt;SHOW CURRENT&lt;/code&gt; shows the default value for the configuration parameter. If the configuration parameter requires a restart to take effect, the active values shown might differ from the set values.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHOW CURRENT { &lt;span class=&#34;code-variable&#34;&gt;parameter‑name&lt;/span&gt;[,...] | ALL }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;parameter‑name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Names of configuration parameters to show.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows all configuration parameters set at all levels.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser: &lt;code&gt;SHOW CURRENT ALL&lt;/code&gt; returns masked parameter settings. Attempts to view specific parameter settings return an error.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Show configuration parameters and their settings at all levels.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW CURRENT ALL;
level    |    name                   |setting
---------+---------------------------+---------
DEFAULT  | ActivePartitionCount      | 1
DEFAULT  | AdvanceAHMInterval        | 180
DEFAULT  | AHMBackupManagement       | 0
DATABASE | AnalyzeRowCountInterval   | 3600
SESSION  | ForceUDxFencedMode        | 1
NODE     | MaxClientSessions         | 0
...
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHOW DATABASE</title>
      <link>/en/sql-reference/statements/show-db/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/show-db/</guid>
      <description>
        
        
        &lt;p&gt;Displays configuration parameter values that are set for the database.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
You can also get detailed information on configuration parameters, including their current and default values, by querying system table &lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/config-parameters/&#34;&gt;CONFIGURATION_PARAMETERS&lt;/a&gt;.
&lt;/div&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If the configuration parameter is set but requires a database restart to take effect, the value shown might differ from the active value.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHOW DATABASE &lt;span class=&#34;code-variable&#34;&gt;db‑spec&lt;/span&gt; { &lt;span class=&#34;code-variable&#34;&gt;parameter‑name&lt;/span&gt;[,...] | ALL }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;db‑spec&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Specifies the current database, set to the database name or &lt;code&gt;DEFAULT&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;parameter‑name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Names of one or more configuration parameters to show.Non-superusers can only specify parameters whose settings are not masked by &lt;code&gt;SHOW DATABASE...ALL&lt;/code&gt;, otherwise Vertica returns an error.
&lt;p&gt;If you specify a single parameter that is not set, &lt;code&gt;SHOW DATABASE&lt;/code&gt; returns an empty row for that parameter.&lt;/p&gt;
&lt;p&gt;To obtain the names of database-level parameters, query system table 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/config-parameters/&#34;&gt;CONFIGURATION_PARAMETERS&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows all configuration parameters set at the database level.For non-superusers, Vertica masks settings of security parameters, which only superusers can access.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Superuser: Shows all database parameter settings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Non-superuser: Masks all security parameter settings, which only superusers can access. To determine which parameters require superuser privileges, query system table 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/config-parameters/&#34;&gt;CONFIGURATION_PARAMETERS&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Show to a non-superuser all configuration parameters that are set on the database:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW DATABASE DEFAULT ALL;
              name              | setting
--------------------------------+----------
 AllowNumericOverflow           | 1
 CopyFaultTolerantExpressions   | 1
 GlobalHeirUsername             | ********
 MaxClientSessions              | 50
 NumericSumExtraPrecisionDigits | 0
(6 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Show settings for two configuration parameters:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW DATABASE DEFAULT AllowNumericOverflow, NumericSumExtraPrecisionDigits;
              name              | setting
--------------------------------+---------
 AllowNumericOverflow           | 1
 NumericSumExtraPrecisionDigits | 0
(2 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHOW NODE</title>
      <link>/en/sql-reference/statements/show-node/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/show-node/</guid>
      <description>
        
        
        &lt;p&gt;Displays configuration parameter values that are set for a node. If you specify a parameter that is not set, &lt;code&gt;SHOW NODE&lt;/code&gt; returns an empty row for that parameter.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If the configuration parameter is set but requires a database restart to take effect, the value shown might differ from the active value.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHOW NODE &lt;span class=&#34;code-variable&#34;&gt;node‑name&lt;/span&gt; { &lt;span class=&#34;code-variable&#34;&gt;parameter‑name&lt;/span&gt; [,...] | ALL }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;node‑name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the target node.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;parameter‑name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Names of one or more node-level configuration parameters. To obtain the names of node-level parameters, query system table 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/config-parameters/&#34;&gt;CONFIGURATION_PARAMETERS&lt;/a&gt;&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows all configuration parameters set at the node level.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;View all configuration parameters and their settings for node &lt;code&gt;v_vmart_node0001&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW NODE v_vmart_node0001 ALL;
           name            | setting
---------------------------+---------
 DefaultIdleSessionTimeout | 5 hour
 MaxClientSessions         | 20
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHOW SESSION</title>
      <link>/en/sql-reference/statements/show-session/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/show-session/</guid>
      <description>
        
        
        &lt;p&gt;Displays configuration parameter values that are set for the current session. If you specify a parameter that is not set, &lt;code&gt;SHOW SESSION&lt;/code&gt; returns an empty row for that parameter.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If the configuration parameter is set but requires a database restart to take effect, the value shown might differ from the active value.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHOW SESSION { ALL | UDPARAMETER ALL }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows all Vertica configuration parameters set at the session level.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;UDPARAMETER ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Shows all parameters defined by user-defined extensions. These parameters are not shown in the CONFIGURATION_PARAMETERS table.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;View all Vertica configuration parameters and their settings for the current session. User-defined parameters are not included:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW SESSION ALL;
name                        |                      setting
----------------------------+---------------------------------------------------
locale                      | en_US@collation=binary (LEN_KBINARY)
autocommit                  | off
standard_conforming_strings | on
escape_string_warning       | on
datestyle                   | ISO, MDY
intervalstyle               | plain
timezone                    | America/New_York
search_path                 | &amp;#34;$user&amp;#34;, public, v_catalog, v_monitor, v_internal
transaction_isolation       | READ COMMITTED
transaction_read_only       | false
resource_pool               | general
memorycap                   | UNLIMITED
tempspacecap                | UNLIMITED
runtimecap                  | UNLIMITED
enabled roles               | dbduser*, dbadmin*, pseudosuperuser*
available roles             | dbduser*, dbadmin*, pseudosuperuser*
ForceUDxFencedMode          | 1
(17 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHOW USER</title>
      <link>/en/sql-reference/statements/show-user/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/show-user/</guid>
      <description>
        
        
        &lt;p&gt;Displays configuration parameter settings for database users. To get the names of user-level parameters, query system table &lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/config-parameters/&#34;&gt;CONFIGURATION_PARAMETERS&lt;/a&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT parameter_name, allowed_levels FROM configuration_parameters
      WHERE allowed_levels ilike &amp;#39;%USER%&amp;#39; AND parameter_name ilike &amp;#39;%depot%&amp;#39;;
     parameter_name      |     allowed_levels
-------------------------+-------------------------
 UseDepotForWrites       | SESSION, USER, DATABASE
 DepotOperationsForQuery | SESSION, USER, DATABASE
 UseDepotForReads        | SESSION, USER, DATABASE
(3 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHOW USER { &lt;span class=&#34;code-variable&#34;&gt;user‑name&lt;/span&gt; | ALL } [PARAMETER] { &lt;span class=&#34;code-variable&#34;&gt;cfg‑parameter&lt;/span&gt; [,...] | ALL }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;user‑name&lt;/code&gt;&lt;/em&gt;&lt;code&gt; | ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Show parameter settings for the specified user, or for all users.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[PARAMETER] &lt;/code&gt;&lt;em&gt;&lt;code&gt;parameter-list&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of user-level configuration parameters.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;PARAMETER ALL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Show all configuration parameters that are set for the specified users.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers: Can view only their own configuration parameter settings.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example shows configuration parameter settings for two users, Yvonne and Ahmed:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT user_name FROM v_catalog.users WHERE user_name != &amp;#39;dbadmin&amp;#39;;
 user_name
-----------
 Ahmed
 Yvonne
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SHOW USER Yvonne PARAMETER ALL;
  user  |        parameter        | setting
--------+-------------------------+---------
 Yvonne | DepotOperationsForQuery | Fetches
(1 row)

=&amp;gt; ALTER USER Yvonne SET PARAMETER UseDepotForWrites = 0;
ALTER USER
=&amp;gt; SHOW USER Yvonne PARAMETER ALL;
  user  |        parameter        | setting
--------+-------------------------+---------
 Yvonne | DepotOperationsForQuery | Fetches
 Yvonne | UseDepotForWrites       | 0
(2 rows)

=&amp;gt; ALTER USER Ahmed SET PARAMETER DepotOperationsForQuery = &amp;#39;Fetches&amp;#39;;
ALTER USER
=&amp;gt; SHOW USER ALL PARAMETER ALL;
  user  |        parameter        | setting
--------+-------------------------+---------
 Ahmed  | DepotOperationsForQuery | Fetches
 Yvonne | DepotOperationsForQuery | Fetches
 Yvonne | UseDepotForWrites       | 0
(3 rows)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/alter-statements/alter-user/&#34;&gt;ALTER USER&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: START TRANSACTION</title>
      <link>/en/sql-reference/statements/start-transaction/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/start-transaction/</guid>
      <description>
        
        
        &lt;p&gt;Starts a transaction block.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;START TRANSACTION [ &lt;span class=&#34;code-variable&#34;&gt;isolation_level&lt;/span&gt; ]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;where &lt;em&gt;isolation_level&lt;/em&gt; is one of:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }READ { ONLY | WRITE }
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;p&gt;Isolation level, described in the following table, determines what data the transaction can access when other transactions are running concurrently. The isolation level cannot be changed after the first query (&lt;code&gt;SELECT&lt;/code&gt;) or DML statement (&lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;) has run. A transaction retains its isolation level until it completes, even if the session&#39;s isolation level changes during the transaction. Vertica internal processes (such as the &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/tuple-mover-tm/&#34; title=&#34;The Tuple Mover manages ROS data storage.&#34;&gt;Tuple Mover&lt;/a&gt; and &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/refresh-projections/&#34; title=&#34;Ensures that all projections on a node are up-to-date (can participate in query execution).&#34;&gt;refresh&lt;/a&gt; operations) and DDL operations always run at the SERIALIZABLE isolation level to ensure consistency.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;WORK | TRANSACTION&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Have no effect; they are optional keywords for readability.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ISOLATION LEVEL { | SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED } &lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;SERIALIZABLE: Sets the strictest level of SQL transaction isolation. This level emulates transactions serially, rather than concurrently. It holds locks and blocks write operations until the transaction completes. Not recommended for normal query operations.&lt;/li&gt;
&lt;li&gt;REPEATABLE READ: Automatically converted to SERIALIZABLE by Vertica.&lt;/li&gt;
&lt;li&gt;READ COMMITTED (Default): Allows concurrent transactions. Use READ COMMITTED isolation for normal query operations, but be aware that there is a subtle difference between them. See&lt;a href=&#34;../../../en/admin/transactions/&#34;&gt;Transactions&lt;/a&gt;for more information.&lt;/li&gt;
&lt;li&gt;READ UNCOMMITTED: Automatically converted to READ COMMITTED by Vertica.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;READ {WRITE | ONLY}&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Determines whether the transaction is read/write or read-only. Read/write is the default.
&lt;p&gt;Setting the transaction session mode to read-only disallows the following SQL commands, but does not prevent all disk write operations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;INSERT, UPDATE, DELETE, and COPY if the table they would write to is not a temporary table&lt;/li&gt;
&lt;li&gt;All CREATE, ALTER, and DROP commands&lt;/li&gt;
&lt;li&gt;GRANT, REVOKE, and EXPLAIN if the command it would run is among those listed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/statements/begin/&#34;&gt;BEGIN&lt;/a&gt; performs the same function as START TRANSACTION.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;This example shows how to start a transaction.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;= &amp;gt; START TRANSACTION ISOLATION LEVEL READ COMMITTED READ WRITE;
START TRANSACTION
=&amp;gt; CREATE TABLE sample_table (a INT);
CREATE TABLE
=&amp;gt; INSERT INTO sample_table (a) VALUES (1);
OUTPUT
--------
1
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/admin/transactions/&#34;&gt;Transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/inserting-data-ado-net/creating-and-rolling-back-transactions/&#34;&gt;Creating and rolling back transactions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/end/&#34;&gt;END&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/rollback/&#34;&gt;ROLLBACK&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: TRUNCATE TABLE</title>
      <link>/en/sql-reference/statements/truncate-table/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/truncate-table/</guid>
      <description>
        
        
        &lt;p&gt;Removes all storage associated with a table, while leaving the table definition intact. TRUNCATE TABLE auto-commits the current transaction after statement execution and cannot be rolled back.&lt;/p&gt;
&lt;p&gt;TRUNCATE TABLE also performs the following actions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Removes all table history preceding the current epoch. After TRUNCATE TABLE returns, AT EPOCH queries on the truncated table return nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Drops all &lt;a href=&#34;../../../en/admin/collecting-db-statistics/collecting-table-statistics/&#34;&gt;table&lt;/a&gt;- and &lt;a href=&#34;../../../en/admin/collecting-db-statistics/collecting-partition-statistics/&#34;&gt;partition&lt;/a&gt;-level statistics.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;TRUNCATE TABLE [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;table‑name &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database.&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table‑name &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The name of the anchor table or temporary table to truncate. You cannot truncate an external table.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privileges on table schema&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/admin/working-with-native-tables/removing-table-data/truncating-tables/&#34;&gt;Truncating tables&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/delete/&#34;&gt;DELETE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/sql-reference/statements/drop-statements/drop-table/&#34;&gt;DROP TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: UPDATE</title>
      <link>/en/sql-reference/statements/update/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/update/</guid>
      <description>
        
        
        &lt;p&gt;Replaces the values of the specified columns in all rows for which a specified condition is true. All other columns and rows in the table are unchanged. If successful, &lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt; returns the number of rows updated. A count of 0 indicates no rows matched the condition.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The Vertica implementation of &lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt; differs from traditional databases. It does not delete data from disk storage; it writes two rows, one with new data and one marked for deletion. Rows marked for deletion remain available for historical queries.
&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;UPDATE [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table-reference &lt;/span&gt;[AS] &lt;span class=&#34;code-variable&#34;&gt;alias &lt;/span&gt;
    SET &lt;span class=&#34;code-variable&#34;&gt;set‑expression&lt;/span&gt; [,...]
    [ FROM &lt;span class=&#34;code-variable&#34;&gt;from-list &lt;/span&gt;]
    [ &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/statements/select/where-clause/&#34;&gt;where‑clause&lt;/a&gt;&lt;/span&gt; ]
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;UPDATE statements can also embed the following &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/&#34;&gt;hints&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;General: &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/allnodes/&#34;&gt;ALLNODES&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/early-materialization/&#34;&gt;EARLY_MATERIALIZATION&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/&#34;&gt;LABEL&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/skip-statistics/&#34;&gt;SKIP_STATISTICS&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/verbatim/&#34;&gt;VERBATIM&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Join: &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/syntactic-join/&#34;&gt;SYNTACTIC_JOIN&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/distrib/&#34;&gt;DISTRIB&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/gbytype/&#34;&gt;GBYTYPE&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/jtype/&#34;&gt;JTYPE&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/utype/&#34;&gt;UTYPE&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Projection: &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/projs/&#34;&gt;PROJS&lt;/a&gt;, &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/skip-projs/&#34;&gt;SKIP_PROJS&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table‑reference&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A table, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;An optionally qualified table name with optional table aliases, column aliases, and outer joins.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An outer join table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You cannot update a projection.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;alias&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A temporary name used to reference the table.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;SET &lt;/code&gt;&lt;em&gt;&lt;code&gt;set‑expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The columns to update from one or more set expressions. Each &lt;span class=&#34;sql&#34;&gt;SET&lt;/span&gt; clause expression specifies a target column and its new value as follows:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;column-name&lt;/span&gt; =  { &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;| DEFAULT }
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;*&lt;/code&gt;column-name&lt;code&gt;*&lt;/code&gt;&lt;/em&gt; is any column that does not have primary key or foreign key &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/referential-integrity/&#34; title=&#34;Consists of a set of constraints (logical schema objects) that define primary key and foreign key columns.&#34;&gt;referential integrity&lt;/a&gt; constraints and is not of a complex type. Native arrays are permitted.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; specifies a value to assign to the column. The expression can use the current values of this and other table columns. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; UPDATE T1 SET C1 = C1+1
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;DEFAULT&lt;/code&gt; sets &lt;em&gt;&lt;code&gt;column-name&lt;/code&gt;&lt;/em&gt; to its default value, or is ignored if no default value is defined for this column.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt; only modifies the columns specified by the &lt;span class=&#34;sql&#34;&gt;SET&lt;/span&gt; clause. Unspecified columns remain unchanged.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;FROM &lt;/code&gt;&lt;em&gt;&lt;code&gt;from‑list&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A list of table expressions, allowing columns from other tables to appear in the &lt;span class=&#34;sql&#34;&gt;WHERE&lt;/span&gt; condition and the &lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt; expressions. This is similar to the list of tables that can be specified in the &lt;a href=&#34;../../../en/sql-reference/statements/select/from-clause/&#34;&gt;FROM clause&lt;/a&gt; of a &lt;span class=&#34;sql&#34;&gt;SELECT&lt;/span&gt; command.
&lt;p&gt;The FROM clause can reference the target table as follows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;FROM DEFAULT [&lt;span class=&#34;code-variable&#34;&gt;join-type&lt;/span&gt;] JOIN &lt;span class=&#34;code-variable&#34;&gt;table-reference&lt;/span&gt; [ ON &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/predicates/interpolate/join-predicate/&#34;&gt;join-predicate&lt;/a&gt;&lt;/span&gt; ]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;DEFAULT specifies the table to update. This keyword can be used only once in the FROM clause, and it cannot be used elsewhere in the UPDATE statement.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Table owner or user with GRANT OPTION is grantor.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;UPDATE privilege on table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on schema that contains the table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;SELECT privilege on the table when executing an UPDATE statement that references table column values in a WHERE or SET clause&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;subqueries-and-joins&#34;&gt;Subqueries and joins&lt;/h2&gt;
&lt;p&gt;&lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt; supports subqueries and joins, which is useful for updating values in a table based on values that are stored in other tables. For details, see &lt;a href=&#34;../../../en/data-analysis/queries/subqueries/subqueries-update-and-delete-statements/&#34;&gt;Subqueries in UPDATE and DELETE statements&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;committing-successive-table-changes&#34;&gt;Committing successive table changes&lt;/h2&gt;
&lt;p&gt;Vertica follows the SQL-92 transaction model, so successive INSERT, UPDATE, and DELETE statements are included in the same transaction. You do not need to explicitly start this transaction; however, you must explicitly end it with &lt;a href=&#34;../../../en/sql-reference/statements/commit/&#34;&gt;COMMIT&lt;/a&gt;, or implicitly end it with &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt;. Otherwise, Vertica discards all changes that were made within the transaction.&lt;/p&gt;

&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You cannot update an immutable table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You cannot update columns of &lt;a href=&#34;../../../en/sql-reference/data-types/complex-types/&#34;&gt;complex types&lt;/a&gt; except for native arrays.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the joins specified in the &lt;span class=&#34;sql&#34;&gt;FROM clause or WHERE&lt;/span&gt; predicate produce more than one copy of the row in the target table, the new value of the row in the table is chosen arbitrarily.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If primary key, unique key, or check constraints are enabled for automatic enforcement in the target table, Vertica enforces those constraints when you load new data. If a violation occurs, Vertica rolls back the operation and returns an error.&lt;/p&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If an update would violate a table or schema disk quota, the operation fails. For more information, see &lt;a href=&#34;../../../en/admin/working-with-native-tables/disk-quotas/&#34;&gt;Disk quotas&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;In the &lt;code&gt;fact&lt;/code&gt; table, modify the &lt;code&gt;price&lt;/code&gt; column value for all rows where the &lt;code&gt;cost&lt;/code&gt; column value is greater than 100:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; UPDATE fact SET price = price - cost * 80 WHERE cost &amp;gt; 100;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the &lt;code&gt;retail.customer&lt;/code&gt; table, set the &lt;code&gt;state&lt;/code&gt; column to &lt;code&gt;NH&lt;/code&gt; when the &lt;code&gt;CID&lt;/code&gt; column value is greater than 100:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; UPDATE retail.customer SET state = &amp;#39;NH&amp;#39; WHERE CID &amp;gt; 100;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use table aliases in &lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt; queries, consider the following two tables:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM result_table;
 cust_id |      address
---------+--------------------
      20 | Lincoln Street
      30 | Beach Avenue
      30 | Booth Hill Road
      40 | Mt. Vernon Street
      50 | Hillside Avenue
(5 rows)
=&amp;gt; SELECT * FROM new_addresses;
 new_cust_id | new_address
-------------+---------------
          20 | Infinite Loop
          30 | Loop Infinite
          60 | New Addresses
(3 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following query and subquery use table aliases to update the &lt;code&gt;address&lt;/code&gt; column in &lt;code&gt;result_table&lt;/code&gt; (alias &lt;code&gt;r&lt;/code&gt;) with the new address from the corresponding column in the &lt;code&gt;new_addresses&lt;/code&gt; table (alias &lt;code&gt;n&lt;/code&gt;):&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; UPDATE result_table r
   SET address=n.new_address
   FROM new_addresses n
   WHERE r.cust_id = n.new_cust_id;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;result_table&lt;/code&gt; shows the &lt;code&gt;address&lt;/code&gt; field updates made for customer IDs 20 and 30:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM result_table ORDER BY cust_id;
 cust_id |     address
---------+------------------
      20 | Infinite Loop
      30 | Loop Infinite
      30 | Loop Infinite
      40 | Mt. Vernon Street
      50 | Hillside Avenue
(5 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You cannot use &lt;span class=&#34;sql&#34;&gt;UPDATE&lt;/span&gt; to update individual elements of native arrays. Instead, replace the entire array value. The following example uses &lt;a href=&#34;../../../en/sql-reference/functions/data-type-specific-functions/collection-functions/array-cat/&#34;&gt;ARRAY_CAT&lt;/a&gt; to add an element to an array column:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM singers;
 lname  | fname |                    bands
--------+-------+---------------------------------------------
 Cher   |       | [&amp;#34;Sonny and Cher&amp;#34;]
 Jagger | Mick  | [&amp;#34;Rolling Stones&amp;#34;]
 Slick  | Grace | [&amp;#34;Jefferson Airplane&amp;#34;,&amp;#34;Jefferson Starship&amp;#34;]
(3 rows)

=&amp;gt; UPDATE singers SET bands=ARRAY_CAT(bands,ARRAY[&amp;#39;something new&amp;#39;])
    WHERE lname=&amp;#39;Cher&amp;#39;;
 OUTPUT
--------
      1
(1 row)

=&amp;gt; SELECT * FROM singers;
 lname  | fname |                    bands
--------+-------+---------------------------------------------
 Jagger | Mick  | [&amp;#34;Rolling Stones&amp;#34;]
 Slick  | Grace | [&amp;#34;Jefferson Airplane&amp;#34;,&amp;#34;Jefferson Starship&amp;#34;]
 Cher   |       | [&amp;#34;Sonny and Cher&amp;#34;,&amp;#34;something new&amp;#34;]
(3 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
