Switch to: V9V8V7V6V5

SHOW Statements

Valentina SQL SHOW commands let you query and return information about database objects or state of that objects in a resulting Table. These commands return a VCursor just like a SELECT statement.

TIP: working with a result cursor of a SHOW command you should use access by name but never by index, because future can be added new columns.

Some SHOW commands can be used with both local and remote databases, others only with vserver. To execute a SHOW command working with a local database you can use one of these Valentina API methods:

  • VDatabase.SqlSelect()
  • VDatabase.SqlQuery()
  • VConnection.SqlQuery()

To execute a server only SHOW command you can use only method:

  • VConnection.SqlQuery()

The following table contains list of simple SHOW commands. Each link will move you to a page, which describes the command in details. Please find below also sections about families of SHOW PROPERTIES and SHOW STATUS commands.

Command Server Only
SHOW COLUMNS 0
SHOW DATABASES 0
SHOW KEYVALUES 0
SHOW LINKS 0
SHOW PROCEDURES 0
SHOW TABLES 0
SHOW TRIGGERS 0
SHOW TYPES 0
SHOW EVENTS 1
SHOW PROJECTS 1
SHOW USERS 1
SHOW GRANTS 1

SHOW PROPERTIES Commands

The SHOW PROPERTIES statement is used to list properties of some database object.

Description of result table columns.

The following pages provide detailed information about properties displayed for each object.

Command Server Only
SHOW PROPERTIES 0
SHOW PROPERTIES OF SERVER 1
SHOW PROPERTIES OF CONNECTION 1
SHOW PROPERTIES OF DATABASE 0
SHOW PROPERTIES OF TABLE 0
SHOW PROPERTIES OF FIELD 0
SHOW PROPERTIES OF LINK 0
SHOW PROPERTIES OF INDEX 0

SHOW STATUS Commands

[NEW in 3.3]

The SHOW STATUS command returns statistic information about the specified database object or engine itself. It returns a cursor with 2 columns and few records. The first column contains the name of status parameter, the second column contains the value of this parameter.

Note: that statistic counters are not preserved on disk, so on each launch of DBMS they starts from zero.

The following pages provide detailed information about properties displayed for each object.

Command Server Only
SHOW STATUS OF SERVER 1
SHOW STATUS 0
SHOW STATUS OF DATABASE 0
SHOW STATUS OF TABLE 0
SHOW STATUS OF FIELD 0
SHOW STATUS OF LINK 0
SHOW STATUS OF INDEX 0

SHOW as Sub-Query

You can use the result table of any SHOW command as source for the next query. This gives you a lots of flexibility to filter records and columns to be show in the final result.

Example:

the following query will select 2 rows from table tblPerson that have names “FirstName” and “LastName”.

SELECT * 
FROM (SHOW COLUMNS FROM DATABASE db1 FROM tblPerson)
WHERE name LIKE '%Name%'