Back to Blog

Advanced Topics in VTS – Part 4

A Step by Step guide to using the New HPE Virtual Table Server (VTS)

Introduction to the New HPE Virtual Table Server (VTS) – Part 1
Install and Setting up VTS – Part 2
Coding for VTS – Part 3
Advanced Topics in VTS – Part 4

Working with Tables

Sometimes working with VTS tables isn’t very straight forward.  VTS provides you with a single table for data sharing. Don’t think of it as a database table, think of it more of an Excel table.  There is NO forced row integrity – keeping related data on the same row – thus if you add or remove an item from a column, only that column will increase or decrease by one.  So it is possible that column one might have 100 rows and column two only has 10 rows.   If you need to keep row integrity, you need to make sure you add or remove data by the row and not column.  Just make sure you use the appropriate functions, lrvtc_send_message versus lrvtc_send_row1.

Another thing to remember is that you can only have one table per instance of VTS.  Each table can have multiple columns though.  If you have some data that needs to keep row integrity and other data that doesn’t, you can mix and match data, you just have to be careful and keep like data together in corresponding rows and again use the appropriate functions to access that data.

For example, look at the table below.  This is using one table to store both customer and employee data.  They both have different number of rows.  As long as you add data using the send_row1 function and use all the columns for customer (CustomerID;CompanyName;ContactName;Address;City;PostalCode) you should be fine.  VTS TableNOTE: You’ll have to be careful exporting and importing mixed size data though.  VTS will export null rows as blank rows.  When you import the data back, VTS will then fill the columns with blank, not null, data.  This will cause some issues, since blank and null is handled very different in VTS.  If you have to export and import data with mixed row lengths, I would suggest using multiple instances.

Multiple Instances

If you have multiple sets of data of different row sizes it might be helpful to look at using additional instances of VTS.  You can quickly start and stop additional instances under Options, which is on the upper right-hand side of the VTS window. VTS Other Instances
When starting a new VTS instance, you’ll have to supply an instance name and also a new port.  You’ll use this name and port to connect to the new instance.  You’ll need a vtc_connect for each instance.

VTS Start Instance
Note: If you are using multiple instances in a script, you will be using the vtc functions and not the lrvtc functions.  It is highly recommended that you don’t mix vtc and lrvtc functions in the same script.  vtc functions will not be covered in this article.  I would suggestion reviewing the Function Reference guide in the VuGen.

Importing/Exporting

VTS allows you to import data from an existing data source if needed. There is an ‘import’ option available which will allow you to connect to an existing DB or to a CSV file.  You can also use the Export and Importing to back up and restore your tables.

Note:  If you are using mixed row size data, exporting will change null values to blank to ensure all rows are filled with data.  This will pad any short column with blank lines of data. VTS Import

 

Back to Blog