Skip to contents

Executes a raw SQL SELECT query and returns results as a data.table. Use this for custom queries not covered by the typed accessor functions.

The unlist parameter is useful for config lookups where you expect exactly one row and want direct field access (result$field_name).

Usage

dbArtGet(qry, cn = NULL, unlist = FALSE, by_rows = FALSE)

Arguments

qry

SQL SELECT query string. Must be a valid SELECT statement.

cn

Database connection. If NULL, opens and closes automatically. Pass an existing connection to batch multiple queries efficiently.

unlist

If TRUE, returns result as a list instead of data.table. Useful for single-row lookups.

by_rows

If TRUE and unlist=TRUE, applies list conversion by rows.

Value

data.table with query results, or list if unlist=TRUE

See also

Other db-interface: dbArtAppend(), dbArtUpdate()