queryGetRow

Returns a struct having all the columns as keys and their corresponding values.

queryGetRow( query, rowNumber ); → returns struct

Member Function Syntax

someQuery.getRow(rowNumber)

Argument Reference

query query
Required

query object do get data from.

rowNumber numeric
Required

position of the row to be returned.

Examples
Sample code invoking the queryGetRow function

news = queryNew("id,title",
    "integer,varchar",
    [ {"id":1,"title":"Dewey defeats Truman"}, {"id":2,"title":"Man walks on Moon"} ]);
writeOutput( serializeJSON( queryGetRow(news, 1) ) );

Expected Result: {"title":"Dewey defeats Truman","id":1}

news = queryNew("id,title",
    "integer,varchar",
    [ {"id":1,"title":"Dewey defeats Truman"}, {"id":2,"title":"Man walks on Moon"} ]);
writeOutput( serializeJSON( news.getRow(1) ) );

Expected Result: {"title":"Dewey defeats Truman","id":1}

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub