query.renameColumn()
Rename a column
Introduced: 6.0.0.57
query.renameColumn( column=string, newColumnName=string )
Returns: void
Argument | Description |
---|---|
column
string,
required
|
Name of the column to rename. Alias: columnName |
newColumnName
string,
required
|
New name of the column. |
Examples
qry= queryNew( "name , age" , "varchar , integer" , [ [ "Susi" , 20 ] , [ "Urs", 24 ] ]);
<span class="nf">writeOutput</span><span class="p">(</span><span class="s2">"Before changing the QueryColumn name : "</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">qry</span><span class="p">);</span>
<span class="nf">qry.renameColumn</span><span class="p">(</span> <span class="s2">"name"</span><span class="p">,</span> <span class="s2">"employee"</span> <span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span><span class="s2">"After changing the QueryColumn name : "</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">qry</span><span class="p">);</span>