QueryRenameColumn()
Rename a column
Introduced: 6.0.0.57
QueryRenameColumn( query=query, column=string, newColumnName=string );
Returns: void
Argument | Description |
---|---|
query
query,
required
|
Name of a query object. |
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" , 24 ] , [ "Urs", 28 ] ]);
<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">QueryRenameColumn</span><span class="p">(</span> <span class="nv">qry</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>
See also
- Queries
- query.renameColumn()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)