queryKeyExists

Determines whether the specified column (key) is present in a query.

queryKeyExists(query, key) → returns boolean

Member Function Syntax

query.keyExists(key)

Argument Reference

query query
Required

Query Object to test.

key string
Required

Key to test

Examples
Sample code invoking the queryKeyExists function

Uses the member function syntax

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

Expected Result: true

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

Fork me on GitHub