User Guide
13
point, the XSQL receives a notification, confirms that the
module’s YANG model resides in the Schema Context, and
then maps the model to XSQL by setting up the necessary
vtables and vfields. This command is useful when you need
to determine vtable information for a query.
list vfields
<vtable name>
Lists the vfields present in a specific vtable. This command
is useful when you need to determine vfields information
for a query.
jdbc
<ip address>
When the ODL server is behind a firewall, and the
JDBC client cannot connect to the JDBC server, run this
command to start the client as if it was a server and
establish a connection.
exit
Closes the console.
tocsv
Enables/disables the forwarding of query output as a .csv
file.
filename
<filename>
Specifies the .tocsv file to which query data is exported. If
you do not specify a value for this option when the toccsv
option is enabled, the filename for the query data file is
generated automatically.
XSQL Queries
Using the information provided by the
list vtables
and
list vfields
<vtable name>
commands, you can run a query to extract information that meets the criteria you specify.
Any query you run should be structured as follows:
select
<vfields you want to search for, separated by a comma and a space>
from
<vtables
you want to search in, separated by a comma and a space>
where
<criteria>
’
<criteria
operator>
’;
For example, say you want to search the nodes/node.ID field in the nodes/node-connector
table and find every instance of the Hardware-Address object that contains
BA
in its text
string. To do so, you would enter the following query:
Select nodes/node.ID from nodes/
node-connector where Hardware-Address like ’%BA%’;
The following criteria operators are supported:
Table 3.2. Supported XSQL Query Criteria Operators
Criteria Operators
Description
=
Lists results that equal the value you specify.
!=
Lists results that do not equal the value you specify.
like
Lists results that contain the substring you specify. For
example, if you specify
like %BC%
, every string that
contains that particular substring is displayed.
<
Lists results that are less than the value you specify.
>
Lists results that are more than the value you specify.
and
Lists results that match both values you specify.
or
Lists results that match either of the two values you
specify.
>=
Lists results that are more than or equal to the value you
specify.
⇐
Lists results that are less than or equal to the value you
specify.