Difference between revisions of "ALTER VIRTUALTABLE"

From Lianjapedia
Jump to: navigation, search
Line 17: Line 17:
 
The ALTER VIRTUALTABLE command modifies a virtual table in the current database.  Virtual tables exist in the database and are handled by CursorAdapters allowing remote/external ODBC data based on SQL SELECT statements to be treated as regular Lianja tables.  Any code that references these tables e.g. USE <virtualtable> connects via the CursorAdapter and retrieves the data.  Updates and deletes are handled transparently via the CursorAdapter.  All CursorAdapters automatically use ODBC connection pooling against the same ODBC DSN to maximize performance.  
 
The ALTER VIRTUALTABLE command modifies a virtual table in the current database.  Virtual tables exist in the database and are handled by CursorAdapters allowing remote/external ODBC data based on SQL SELECT statements to be treated as regular Lianja tables.  Any code that references these tables e.g. USE <virtualtable> connects via the CursorAdapter and retrieves the data.  Updates and deletes are handled transparently via the CursorAdapter.  All CursorAdapters automatically use ODBC connection pooling against the same ODBC DSN to maximize performance.  
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
!width=40%|Keywords||width=60%|Description
+
!width="40%"|Keywords||width="60%"|Description
 
|-
 
|-
|valign=top|[database]||The name of the database in which the virtual table should be created.  The '!' character must be included between the database name and the virtual table name.
+
|valign="top"|[database]||The name of the database in which the virtual table should be created.  The '!' character must be included between the database name and the virtual table name.
 
|-
 
|-
|valign=top|<virtualtable>||The name of the virtual table to be created.
+
|valign="top"|<virtualtable>||The name of the virtual table to be created.
 
|-
 
|-
|valign=top|[ALIAS <name>]||The optional [[ALIAS()|alias]] name for the virtual table.
+
|valign="top"|[ALIAS <name>]||The optional [[ALIAS()|alias]] name for the virtual table.
 
|-
 
|-
 
|CONNSTR <odbc_dsn_string>||valign=top|The ODBC connection string.
 
|CONNSTR <odbc_dsn_string>||valign=top|The ODBC connection string.

Revision as of 10:44, 5 February 2013

Purpose

Creates a virtual table

Syntax

ALTER VIRTUALTABLE [<database>!]<virtualtable>

[ALIAS <name>]

CONNSTR <odbc_dsn_string>

AS <select statement>

See Also

ADD TABLE, ALTER INDEX, ALTER TABLE, COPY DATABASE, CREATE VIRTUALTABLE, CONSTRAINTS, CREATE DATABASE, CREATE TABLE, CursorAdapter, CURSORADAPTER(), DATA TYPES, DROP DATABASE, DROP TABLE, GETENV(), INSERT, OPEN DATABASE, SELECT, SET XMLFORMAT, USE

Description

The ALTER VIRTUALTABLE command modifies a virtual table in the current database. Virtual tables exist in the database and are handled by CursorAdapters allowing remote/external ODBC data based on SQL SELECT statements to be treated as regular Lianja tables. Any code that references these tables e.g. USE <virtualtable> connects via the CursorAdapter and retrieves the data. Updates and deletes are handled transparently via the CursorAdapter. All CursorAdapters automatically use ODBC connection pooling against the same ODBC DSN to maximize performance.

Keywords Description
[database] The name of the database in which the virtual table should be created. The '!' character must be included between the database name and the virtual table name.
<virtualtable> The name of the virtual table to be created.
[ALIAS <name>] The optional alias name for the virtual table.
CONNSTR <odbc_dsn_string> The ODBC connection string.
AS <select statement> The SQL SELECT statement.

Example

open database advworks
create virtualtable scurr connstr "awhr" as select * from sales.currency
alter virtualtable scurr connstr "awhr" as select name from sales.currency