Creating a virtual table
Use the POST create command to create a virtual table.
Use this command if you want to create a new virtual table in a new InfoSphere® Information Analyzer project.
Note: To create a virtual table in an existing InfoSphere Information Analyzer project, use
the POST update command.
Command
POST create
Parameters
- virtual table Content
- A parameter that indicates there is an associated XML document that describes the data to create or update within the project.
Example HTTP request
https://ServerName:9443/ibm/iis/ia/api/create
Example XML string: Creating an empty project
The
following XML string creates an empty project that has the name newProject:
<?xml version="1.0" encoding="UTF-8"?>
<iaapi:Project xmlns:iaapi="http://www.ibm.com/investigate/api/iaapi"
name="newProject"/>
Example XML string: Creating a classical virtual table
The
following XML string creates a classical virtual table with the name VIRTUAL_TABLE in
the project with the name ProjectName registered
in the schema BANK of the source SOURCE.
The virtual table is a subset of the base table CLIENTS in
the same schema where only the columns, LASTNAME, FIRSTNAME, DATEOFBIRTH,
GROSSSALES, GENDER, for the rows validating the condition "GENDER='F'"
are retrieved:
<?xml version="1.0" encoding="UTF-8"?>
<iaapi:Project xmlns:iaapi="http://www.ibm.com/investigate/api/iaapi" name="ProjectName">
<DataSources>
<DataSource name="SOURCE">
<Schema name="BANK">
<VirtualTable name="VIRTUAL_TABLE" baseTable="CLIENTS">
<WhereCondition>GENDER='F'</WhereCondition>
<Column name="LASTNAME"/>
<Column name="FIRSTNAME"/>
<Column name="DATEOFBIRTH"/>
<Column name="GROSSSALES"/>
<Column name="GENDER"/>
</VirtualTable>
</Schema>
</DataSource>
</DataSources>
</iaapi:Project>
Example XML string: Creating a SQL virtual table
The
following XML string creates a SQL based virtual table SQL_VIRTUAL_TABLE whose
data is the result of the SQL select statement, "SELECT name, gender,
age FROM BANK.BANK_CLIENTS WHERE gender='F'". The name and type of
the columns we expect from the result set of the query are specified
by the <Column> elements underneath:
<?xml version="1.0" encoding="UTF-8"?>
<iaapi:Project xmlns:iaapi="http://www.ibm.com/investigate/api/iaapi" name="ProjectName">
<DataSources>
<DataSource name="SOURCE">
<Schema name="BANK">
<VirtualTable name="SQL_VIRTUAL_TABLE">
<SelectStatement>SELECT name, gender, age FROM BANK.BANK_CLIENTS WHERE gender='F'</SelectStatement>
<Column name="name" type="string" length="64"/>
<Column name="gender" type="string" length="2"/>
<Column name="age" type="int32"/>
</VirtualTable>
</Schema>
</DataSource>
</DataSources>
</iaapi:Project>