Executes a SQL query without loading the data entierly to memory. Instead it calls the given Function with every single row
querylazy()
→ returns void
This example demonstrates how to use the querylazy function to execute a query without loading the data entirely to memory.
records = 0
queryLazy(
sql="SELECT * FROM users;",
listener=function(row){
// Do something with a query row
records++;
},
options={
datasource:"MyDatasource"
}
);
echo("Records: #records#");
Expected Result: Recrods: 10
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.