Cory Howitz
01/10/2024, 3:47 PMPatrick
01/10/2024, 3:48 PMPatrick
01/10/2024, 3:49 PMRobert Zehnder
01/10/2024, 3:50 PMCory Howitz
01/10/2024, 4:04 PMgarciadev
01/10/2024, 4:08 PMpublic query function arrayToQuery( required array data, string columnList="", string columnTypeList="" ){
if( arguments.columnList.trim().len() && arguments.columnTypeList.trim().len() ){
return queryNew( arguments.columnList, arguments.columnTypeList, arguments.data );
} else {
return queryNew( arguments.data );
}
}garciadev
01/10/2024, 4:09 PM<cfscript>
data = [
{ id: 1, label: "One" },
{ id: 2, label: "Two" },
{ id: 3, label: "Three" },
{ id: 4, label: "Four" }
];
writedump( arrayToQuery( data, "id,label", "integer,varchar" ) );
writedump( arrayToQuery( data ) );
public query function arrayToQuery( required array data, string columnList="", string columnTypeList="" ){
if( arguments.columnList.trim().len() && arguments.columnTypeList.trim().len() ){
return queryNew( arguments.columnList, arguments.columnTypeList, arguments.data );
} else {
return queryNew( arguments.data );
}
}
</cfscript>garciadev
01/10/2024, 4:09 PMgarciadev
01/10/2024, 4:10 PMqueryNew() 🙂Dave Merrill
01/10/2024, 4:21 PMdanmurphy
01/10/2024, 5:51 PMCory Howitz
01/10/2024, 6:17 PM