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">&quot;Before changing the QueryColumn name : &quot;</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">&quot;name&quot;</span><span class="p">,</span> <span class="s2">&quot;employee&quot;</span> <span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span><span class="s2">&quot;After changing the QueryColumn name : &quot;</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">qry</span><span class="p">);</span>

See also