blob: a5bc219bbb7c08fc2f59c8409e7267aababd21ae [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MADlib: compatibility.sql_in File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<script src="../mathjax/MathJax.js">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">MADlib
&#160;<span id="projectnumber">0.6</span> <span style="font-size:10pt; font-style:italic"><a href="../latest/./compatibility_8sql__in.html"> A newer version is available</a></span>
</div>
<div id="projectbrief">User Documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="dynsections.js"></script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('compatibility_8sql__in.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">compatibility.sql_in File Reference</div> </div>
</div>
<div class="contents">
<p>Compatibility SQL functions.
<a href="#details">More...</a></p>
<p><a href="compatibility_8sql__in_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compatibility_8sql__in.html#a62af9c8b5618f77beaee1b2e1c411714">insert_into</a> (varchar inTableName, varchar inSQL)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Mimick <code>INSERT INTO</code>. Create new rows in a table. <a href="#a62af9c8b5618f77beaee1b2e1c411714"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compatibility_8sql__in.html#a7e4ff90d5d720d76651643eefa66cd14">create_table_as</a> (varchar inTableName, varchar inSQL, varchar inDistributed=&quot;RANDOMLY&quot;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Mimick <code>CREATE TABLE AS</code>. Create a table and fill it with data computed by a <code>SELECT</code> command. <a href="#a7e4ff90d5d720d76651643eefa66cd14"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compatibility_8sql__in.html#a3f1c139a9b5dceb5312f730be2a5868d">create_temporary_table_as</a> (varchar inTableName, varchar inSQL, varchar inDistributed=&quot;RANDOMLY&quot;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Mimick <code>CREATE TEMPORARY TABLE AS</code>. Create a temporary table and fill it with data computed by a <code>SELECT</code> command. <a href="#a3f1c139a9b5dceb5312f730be2a5868d"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="see"><dt><b>See also:</b></dt><dd>For a brief overview of compatibility functions, see the module description <a class="el" href="group__grp__compatibility.html">Compatibility</a>. </dd></dl>
<p>Definition in file <a class="el" href="compatibility_8sql__in_source.html">compatibility.sql_in</a>.</p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a7e4ff90d5d720d76651643eefa66cd14"></a><!-- doxytag: member="compatibility.sql_in::create_table_as" ref="a7e4ff90d5d720d76651643eefa66cd14" args="(varchar inTableName, varchar inSQL, varchar inDistributed=&quot;RANDOMLY&quot;)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void create_table_as </td>
<td>(</td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inTableName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inSQL</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inDistributed</em> = <code>&quot;RANDOMLY&quot;</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">inTableName</td><td>The name (optionally schema-qualified) of the table to be created. </td></tr>
<tr><td class="paramname">inSQL</td><td>A SELECT command. </td></tr>
<tr><td class="paramname">inDistributed</td><td>The Greenplum Database distribution policy for the table. This can be either <code>RANDOMLY</code>, which is the default, or <code>BY (<em>column</em>, [...])</code>. This parameter is ignored on PostgreSQL.</td></tr>
</table>
</dd>
</dl>
<dl class="user"><dt><b>Usage:</b></dt><dd>Use in the same way as the <code>CREATE TABLE AS</code> statement: <pre>SELECT create_table_as('<em>table_name</em>', $$
<em>query</em>
$$, 'BY (<em>column</em>, [...]) | RANDOMLY');</pre></dd></dl>
<dl class="user"><dt><b>Examples:</b></dt><dd><pre>SELECT create_table_as('public.test', $$
SELECT * FROM generate_series(1,10) AS id
$$, 'BY (id)');<br/>
SELECT create_table_as('logregr_result', $$
SELECT * FROM logregr('data', 'y', 'x')
$$, 'RANDOMLY');</pre></dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>This function is a workaround. For compliance with the SQL standard and for optimal performance, please use the normal <code>CREATE TABLE AS</code> statement whenever possible. Known caveats of this workaround:<ul>
<li>For queries returning a large number of rows, this function will be significantly slower than the <code>CREATE TABLE AS</code> statement. </li>
</ul>
</dd></dl>
<p>Definition at line <a class="el" href="compatibility_8sql__in_source.html#l00225">225</a> of file <a class="el" href="compatibility_8sql__in_source.html">compatibility.sql_in</a>.</p>
</div>
</div>
<a class="anchor" id="a3f1c139a9b5dceb5312f730be2a5868d"></a><!-- doxytag: member="compatibility.sql_in::create_temporary_table_as" ref="a3f1c139a9b5dceb5312f730be2a5868d" args="(varchar inTableName, varchar inSQL, varchar inDistributed=&quot;RANDOMLY&quot;)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void create_temporary_table_as </td>
<td>(</td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inTableName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inSQL</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inDistributed</em> = <code>&quot;RANDOMLY&quot;</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="compatibility_8sql__in.html#a7e4ff90d5d720d76651643eefa66cd14" title="Mimick CREATE TABLE AS. Create a table and fill it with data computed by a SELECT command...">create_table_as()</a> </dd></dl>
<p>Definition at line <a class="el" href="compatibility_8sql__in_source.html#l00258">258</a> of file <a class="el" href="compatibility_8sql__in_source.html">compatibility.sql_in</a>.</p>
</div>
</div>
<a class="anchor" id="a62af9c8b5618f77beaee1b2e1c411714"></a><!-- doxytag: member="compatibility.sql_in::insert_into" ref="a62af9c8b5618f77beaee1b2e1c411714" args="(varchar inTableName, varchar inSQL)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void insert_into </td>
<td>(</td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inTableName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>inSQL</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">inTableName</td><td>The name (optionally schema-qualified) of an existing table. </td></tr>
<tr><td class="paramname">inSQL</td><td>A SELECT command.</td></tr>
</table>
</dd>
</dl>
<dl class="user"><dt><b>Usage:</b></dt><dd>Use in the same way as the <code>INSERT INTO</code> statement: <pre>SELECT insert_into('<em>table_name</em>', $$
<em>query</em>
$$);</pre></dd></dl>
<dl class="user"><dt><b>Examples:</b></dt><dd><pre>SELECT insert_into('public.test', $$
SELECT * FROM generate_series(1,10) AS id
$$);<br/>
SELECT insert_into('logregr_results', $$
SELECT * FROM logregr('data', 'y', 'x')
$$);</pre></dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>This function is a workaround. For compliance with the SQL standard and for optimal performance, please use the normal <code>INSERT INTO</code> statement whenever possible. Known caveats of this workaround:<ul>
<li>For queries returning a large number of rows, this function will be significantly slower than the <code>INSERT INTO</code> statement. </li>
</ul>
</dd></dl>
<p>Definition at line <a class="el" href="compatibility_8sql__in_source.html#l00110">110</a> of file <a class="el" href="compatibility_8sql__in_source.html">compatibility.sql_in</a>.</p>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="compatibility_8sql__in.html">compatibility.sql_in</a> </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<li class="footer">Generated on Tue Apr 2 2013 14:57:03 for MADlib by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
</ul>
</div>
</body>
</html>