Learn R Programming

RBaseX (version 0.3.0)

Execute: Execute

Description

Executes a database command or a query.

Usage

Execute(...)

Arguments

...

The command or query to be executed. When used to execute a command, a SessionID and a string which contains the command, are to be passed. When used to execute a query, the QueryClass instance-ID is passed.

Value

When used to execute commands in the Standard mode, this function returns a list with the following items:

  • result

  • info Aditional info

  • success A boolean, indicating if the command was completed successfull

When used to execute a query, it return the result as a list.

Details

For a list of database commands see http://docs.basex.org/wiki/Commands

'BaseX' can be used in a Standard mode or Query mode.

In the standard mode of the Clients, a database command can be sent to the server using the Execute() function of the Session. The query mode of the Clients allows you to bind external variables to a query and evaluate the query in an iterative manner.

Examples

Run this code
# NOT RUN {
Session <- NewBasexClient(user = <username>, password = "<password>")
print(Execute(Session, "info")$info)

query_txt <- "for $i in 1 to 2 return <xml>Text { $i }</xml>"
query_obj <- Query(Session, query_txt)
print(Execute(query_obj))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab