Returns a single row as an Nx1 matrix where N is the column count of the
SELECT statement containing the field information for the current query.
qid (scalar) – query number.
columns (string or string array) – Optional input. Gives specific columns to pull from the result matrix. Must be a subset of fields from the
record (matrix) – if the query points to a valid row (
dbQueryIsValid()returns true), the record is populated with the row’s values. An empty record (
scalmiss(record)is true) is returned when there is no active query (
// Execute `qid` query qid = dbExecQuery(db_id, "SELECT YTD, TOTAL FROM GDP"); /* ** Iteratively retrieve single records ** and store as matrix */ do while dbQuerySeekNext(qid); record = dbQueryFetchOneM(qid); ytd = record; total = record; endo;
For string results, or to treat numerical results as a string, using
dbQueryFetchOneSA() will return a string array.