postgreSQL.cursor.fetchMultipleRows

Syntax

postgreSQL.cursor.fetchMultipleRows (cursorRef, adrRows, ctRows, as, flCoerceToUserTalkTypes)

Params

cursorRef is a reference to a cursor as returned by postgreSQL.cursor.create.

adrRows is the address of the variable where the result will be stored.

ctRows is a number indicating the number of rows to be fetched.

as is an optional string4 value indicating the desired result type. Default is listType.

flCoerceToUserTalkTypes is an optional boolean indicating whether PostgreSQL values in the rows should be converted to corresponding UserTalkTypes. Default is true.

Action

Fetch the specified number of rows from the last result set generated by a query or procedure call, and increment the internal row position once for each row to point at the row following the last one returned.

Returns

A boolean that is true if at least one row was fetched, or false if there are no more rows waiting to be fetched.

Examples

postgreSQL.cursor.fetchMultipleRows (cursorRef, @rowList, 2, recordType)

« true //rowList now contains e.g. {{"first":"Ian", "last":"O'Sullivan", "age":48}, {"first":"Bull", "last":"Mancuso", "age":41}}

Notes

If the specified result type is listType, adrRows will point to a list of lists with each sub-list containing the cells from a row in the same order they appear in the result set returned by the server. If the specified result type is recordType, adrRows will point to a list of records with each record containing the cells from a row with the result set's column names serving as item names in the record. These are the only two result types currently supported.

If flCoerceToUserTalkTypes is true (the default), values contained in the returned list will be converted from PostgreSQL data types to corresponding UserTalk data types. The TIME type will be converted to dateType with the date part set to January 1st, 1904. The TIME type will be converted to dateType with the time part set to midnight. The INTERVAL type will be converted to a numberType containing the equivalent number of seconds. PostgreSQL types for which no special conversion rules have been hard-coded in the extension will be returned as strings.

For the data type conversion to work correctly, the PostgreSQL extension automatically sets the date style for each connection to ISO, and you should refrain from changing it, e.g. by running a SET DATESTYLE command over the connection.

If flCoerceToUserTalkTypes is false, all values will be returned as strings, unchanged from how they have been received from the database server.

If the last query or procedure call did not generate a result set or if no query or procedure call has been run yet, this verb generates a script error.

See Also

postgreSQL.cursor.executeQuery

postgreSQL.cursor.executeMultipleQueries

postgreSQL.cursor.callProcedure

postgreSQL.cursor.getDescription

postgreSQL.cursor.fetchOneRow

postgreSQL.cursor.fetchAllRows