(Unsure if dev, dev-support or language…)
After the feedback about the “slow” OOO implementation of Query()
, I had a deeper look at cfquery()
.
The function has 2 parameters, name
and result
. From my point of view, name
is for attributes and result
has the result of the query.
<cfscript>
cfquery(datasource="test", name="qInsert", result="qInsertResult", sql="INSERT INTO test (foobar) VALUES ('#createUUID()#')");
writeDump(structKeyExists(variables, "qInsert")); // false
writeDump(structKeyExists(variables, "qInsertResult")); // true
writeDump(qInsertResult);
cfquery(datasource="test", name="qSelect", result="qSelectResult", sql="SELECT * FROM test");
writeDump(structKeyExists(variables, "qSelect"));
writeDump(qSelect);
writeDump(structKeyExists(variables, "qSelectResult"));
writeDump(qSelectResult);
</cfscript>
Insert: Name doesn’t exist
Insert: Result shows the meta-data for the query
Select: Name shows the result of the query
Select: Result shows the meta-data for the query
(For reference:
Update: Name doesn’t exist
Update: Result shows the meta-data for the query)
Am I missing some kind of system or pattern here?