Adds a specified number of empty rows to a query.
queryAddRow(query [, number/row(s)])
→ returns numeric
someQuery.addRow([number/row(s)])
CF 10+ Pass in row data directly to queryAddRow argument.
news = queryNew("id,title", "integer,varchar");
queryAddRow(news, {"id"=1,"title"="Dewey defeats Truman"});
writeDump(news);
CF 10+ Pass in row data directly to queryAddRow argument.
news = queryNew("id,title", "integer,varchar");
news.addRow({"id"=1,"title"="Dewey defeats Truman"});
writeDump(news);
Using Script with the queryAddRow querySetCell functions to populate the query.
news = queryNew("id,title", "integer,varchar");
queryAddRow(news);
querySetCell(news, "id", "1");
querySetCell(news, "title", "Dewey defeats Truman");
queryAddRow(news);
querySetCell(news, "id", "2");
querySetCell(news, "title", "Men walk on Moon");
writeDump(news);
The example above could be simplified this way:
news = queryNew("id,title", "integer,varchar");
queryAddRow(news,2);
querySetCell(news, "id", "1",1);
querySetCell(news, "title", "Dewey defeats Truman",1);
querySetCell(news, "id", "2",2);
querySetCell(news, "title", "Men walk on Moon",2);
writeDump(news);
CF 10+ The example above could be simplified even more this way:
news = queryNew("id,title", "integer,varchar");
queryAddRow(news, [{"id"=1,"title"="Dewey defeats Truman"},{"id"=2,"title"= "Men walk on Moon"}]);
writeDump(news);
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.