r2dbc_query()

Read(2067) Label: query, sql,

Description:

Query a database through R2DBC.

Syntax:

r2dbc_query(con,sql)

Note:

The external library function (See External Library Guide) queries the specified SQL statement sql in a database and returns a table sequence consisting of the result of the SQL query.

Parameter:

con

Database connection string

sql

The SQL statement to be queried, such as select * from table

Return value:

Table sequence

Example:

 

A

 

1

=r2dbc_open("r2dbc:h2:mem:///testdb?options=DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE")

Connect to H2 database.

2

=r2dbc_query(A1, "select  *  from  table")

Query data in the table.

3

=r2dbc_close(A1)