Switch to: V9V8V7V6V5

VQueryResult Class

NEW in v4.0

Description

Historically, Valentina API did have:

  • SqlSelect() to execute SQL commands that return VCursor back. For example, SELECT or “SHOW …” commands.
  • SqlExecute() to execute all other commands of Valentina SQL. It returns ULONG integer - the number of affected records.

With time we have come to need, for example, in Valentina Studio's SQL Editor, to have single function, which is able execute any Valentina SQL commands.

Answer was in a new function SqlQuery() on each level:

  • database scope : VDatabase.SqlQuery()
  • connection scope: VConnection.SqlQuery()
  • global scope : Valentina.SqlQuery()

This new function must be able to return different results: cursor or ULONG.

We resolve this with the help of small class VQueryResult

When you have a VQueryResult, usually you verify the type of the result, and then use one of the VQueryResult methods to get the specific result.

Properties