com.esri.arcgis.geodatabase
Interface ISqlWorkspace

All Superinterfaces:
Serializable
All Known Implementing Classes:
ISqlWorkspaceProxy, SqlWorkspace

public interface ISqlWorkspace
extends Serializable

Query layer workspace interface

Description

This interface is used to create query classes and query cursors, and to retrieve information about SQL workspaces.

Remarks

A SQL workspace is a relational database that may or may not be a geodatabase. After creating a workspace with the SqlWorkspaceFactory class (and the IWorkspaceFactory interface), this interface is used to retrieve data in a read-only manner as query classes and query cursors. Query classes can be used much like tables or feature classes from other data sources; through ArcMap, they are exposed as "Query Layers".

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void checkDatasetName(String name, IQueryDescription pQueryDescription, String[] pNewName)
          Returns unique name in the workspace.
 void getColumns(String tableName, IStringArray[] ppColumnName, IStringArray[] ppColumnType, IVariantArray[] ppIsNullable, ILongArray[] ppSize, ILongArray[] ppPrecision, ILongArray[] ppScale)
          Returns column information for a table.
 IQueryDescription getQueryDescription(String query)
          Get query properties including spatial based on the first record of the query.
 IStringArray getTables()
          Returns names of all the table.
 ITable openQueryClass(String name, IQueryDescription pQueryDescription)
          Returns a table or a feature class based on a query.
 ICursor openQueryCursor(String query)
          Returns a cursor based on a query.
 

Method Detail

getQueryDescription

IQueryDescription getQueryDescription(String query)
                                      throws IOException,
                                             AutomationException
Get query properties including spatial based on the first record of the query.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
query - The query (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IQueryDescription
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openQueryClass

ITable openQueryClass(String name,
                      IQueryDescription pQueryDescription)
                      throws IOException,
                             AutomationException
Returns a table or a feature class based on a query.

Remarks

If ID mapping was defined in the query description passed into this method, the returned query class will include a virtual column containing unique IDs. Aside from cases where conflicts will occur, this column is named "ESRI_OID".

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
name - The name (in)
pQueryDescription - A reference to a com.esri.arcgis.geodatabase.IQueryDescription (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openQueryCursor

ICursor openQueryCursor(String query)
                        throws IOException,
                               AutomationException
Returns a cursor based on a query.

Remarks

A query cursor generally behaves like a non-recycling search cursor that returns read-only rows.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
query - The query (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ICursor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTables

IStringArray getTables()
                       throws IOException,
                              AutomationException
Returns names of all the table.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.system.IStringArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getColumns

void getColumns(String tableName,
                IStringArray[] ppColumnName,
                IStringArray[] ppColumnType,
                IVariantArray[] ppIsNullable,
                ILongArray[] ppSize,
                ILongArray[] ppPrecision,
                ILongArray[] ppScale)
                throws IOException,
                       AutomationException
Returns column information for a table.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
tableName - The tableName (in)
ppColumnName - A reference to a com.esri.arcgis.system.IStringArray (out: use single element array)
ppColumnType - A reference to a com.esri.arcgis.system.IStringArray (out: use single element array)
ppIsNullable - A reference to a com.esri.arcgis.system.IVariantArray (out: use single element array)
ppSize - A reference to a com.esri.arcgis.system.ILongArray (out: use single element array)
ppPrecision - A reference to a com.esri.arcgis.system.ILongArray (out: use single element array)
ppScale - A reference to a com.esri.arcgis.system.ILongArray (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

checkDatasetName

void checkDatasetName(String name,
                      IQueryDescription pQueryDescription,
                      String[] pNewName)
                      throws IOException,
                             AutomationException
Returns unique name in the workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
name - The name (in)
pQueryDescription - A reference to a com.esri.arcgis.geodatabase.IQueryDescription (in)
pNewName - The pNewName (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.