tracker issue : CF-4201549

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] ER for: QueryNew() columnList from rowData shortcut

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff ()

Created: 03/16/2018

Components: Language, Functions

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: / CF2018U5

Priority/Frequency: Normal /

Locale/System: / Platforms All

Vote Count: 0

This ER is for allowing QueryNew(rowData) shortcut, when rowData is array-of-struct. CF can generate the columnList from rowData's distinct list of key names.

Example: 
{code:java}
queryNew("foo,bar", "", [{foo="foo"},{bar="bar"}]) could be shortened to queryNew([{foo="foo"},{bar="bar"}]) 
{code}
creating a query w/ untyped columns "foo" and "bar".

Attachments:

Comments:

This seems to be a good use-case for NamedParameters as well, For Struct initialization the column queryName can become optional as the details can be fetched from keys defined in the struct. This should also be incorporated while implementing this feature.
Comment by Ashudeep S.
59 | March 16, 2018 01:39:03 PM GMT
This enhancement has been added. It will be available as part of the upcoming update of ColdFusion 2018. -Nimit Sharma
Comment by Nimit S.
31107 | August 07, 2019 09:31:36 AM GMT