executeQuery Documentation

Could someone document executeQuery (or at least) post here until then what
ALL of the options and items in play are here.

Leaving it as this…
(at QueryExecute() :: Lucee Documentation )

queryexecute( caller, sql [, params [, options ] ] )

what are the legitimate params for caller (is that even meant to be there
and not just in the source)? and options? (aka what are ALL the standard
options - are these ‘only’ the options from the cfquery tag, or are there
more?)

I’ve ready 10 different blog entries on this and I’m to be quite honest,
confused completely.

Are you are trying to solve a specific issue? Get started with
queryExecute()? Or improve the documentation?

Not sure, but my impression is that those of us that know more or less how
to use queryExecute() probably feel they don’t know everything there is to
know about the function. I can post examples of how I’m using it in
production, if you think that might help you. I don’t know what the caller
param is about, and I’m fuzzy on the options param, but I think you can
place any attribute in there that you’d use in the cfquery tag.

I really appreciate the queryExecute(), as I can pretty much completely
leave tags behind except in my view templates.

Here’s an example that creates a dynamic query:

     public query function findSecurityControls( date startDate, date

endDate, numeric locationId, numeric employeeId ) {
var newLine = CHR(13) & CHR(10);
var params = {};
var sql = "
select s.securityControlId, s.scDate, l.name as locationName, e.firstName,
e.lastName, u.name as userName, averageRating
from SecurityControl s
left join Location l on s.locationId = l.locationId
left join Employee e on s.employeeId = e.employeeId
left join User u on s.userId = u.userId
where s.isTemplate = 0
and s.scDate >= :startDate
and s.scDate < :endDate
“;
structInsert(params, “startDate”, { value: arguments.startDate, cfsqltype:
“cf_sql_date” } );
structInsert(params, “endDate”, { value: arguments.endDate, cfsqltype:
“cf_sql_date” } );
if ( arguments.locationId > 0 ) {
sql &= newLine & " and s.locationId = :locationId”;
structInsert(params, “locationId”, { value: arguments.locationId,
cfsqltype: “cf_sql_integer” } );
}
if ( arguments.employeeId > 0 ) {
sql &= newLine & " and s.employeeId = :employeeId";
structInsert(params, “employeeId”, { value: arguments.employeeId,
cfsqltype: “cf_sql_integer” } );
}

sql &= newLine & “order by s.scDate”;
return queryExecute( sql, params );
}

Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamediaOn Sat, May 7, 2016 at 5:49 PM, Dawesi <@Christopher_Dawes> wrote:

Could someone document executeQuery (or at least) post here until then
what ALL of the options and items in play are here.

Leaving it as this… (at
QueryExecute() :: Lucee Documentation )

queryexecute( caller, sql [, params [, options ] ] )

what are the legitimate params for caller (is that even meant to be there
and not just in the source)? and options? (aka what are ALL the standard
options - are these ‘only’ the options from the cfquery tag, or are there
more?)

I’ve ready 10 different blog entries on this and I’m to be quite honest,
confused completely.


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/2167eb83-ead7-4fae-a3c8-6509099bebaa%40googlegroups.com
https://groups.google.com/d/msgid/lucee/2167eb83-ead7-4fae-a3c8-6509099bebaa%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.