LibreOffice LibreOffice 6.0 SDK API Reference

Public Member Functions | Public Attributes | List of all members
XTableName Interface Reference

allows to manipulate table names. More...

`import"XTableName.idl";`

## Public Member Functions
string | getComposedName ([in] long Type, [in] boolean Quote) raises ( com::sun::star::lang::IllegalArgumentException )
| returns the composed table name, including the catalog and schema name, respecting the database's quoting requirements, plus More...
void | setComposedName ([in] string ComposedName, [in] long Type)
| sets a new composed table name More...

## Public Attributes
string | CatalogName
| denotes the name of the catalog which the table is a part of More...
string | SchemaName
| denotes the name of the schema which the table is a part of More...
string | TableName
| denotes the mere, unqualified table name, excluding any catalog and schema. More...
string | NameForSelect
| represents the table name in a form to be used in a `SELECT` statement. More...
::com::sun::star::beans::XPropertySet | Table { get raises(com::sun::star::container::NoSuchElementException); set raises(com::sun::star::lang::IllegalArgumentException); }
| is the com::sun::star::sdb::Table object specified by the current name. More...

## Detailed Description

allows to manipulate table names.

When, in a database application, dealing with table names, there's many degrees of freedom to deal with. For instance, suppose you want to have the full name of a table object, as it should be used in a `SELECT` statement's `FROM` part. This requires you to evaluate whether or not the table has a catalog and/or schema name, to combine the catalog, the schema, and the basic table name into one name, respecting the database's quoting character, and the order in which all those parts should be combined. Additionally, you have to respect the client-side settings which tell OpenOffice.org to use or not use catalogs and schemas in `SELECT` at all.

The XTableName interface eases this and other, similar tasks around table names.

The component itself does not have life-time control mechanisms, i.e. you cannot explicitly dispose it (com::sun::star::lang::XComponent::dispose()), and you cannot be notified when it dies.
However, if your try to access any of its methods or attributes, after the connection which was used to create it was closed, a com::sun::star::lang::DisposedException will be thrown.

See also
  XConnectionTools
  com::sun::star::sdbc::XDatabaseMetaData
  com::sun::star::sdb::DataSource::Settings

Since
  OOo 2.0.4

## Member Function Documentation

## ◆ getComposedName()

string getComposedName | ( | [in] long | Type,
|  | [in] boolean | Quote
| ) |  |
raises | ( | com::sun::star::lang::IllegalArgumentException
| ) |  |

returns the composed table name, including the catalog and schema name, respecting the database's quoting requirements, plus

Parameters

  Type | the type of name composition to be used.
  Quote | specifies whether the single parts of the table name should be quoted

See also
  CompositionType

Exceptions

  com::sun::star::IllegalArgumentException | if the given Type does not denote a valid CompositionType

## ◆ setComposedName()

void setComposedName | ( | [in] string | ComposedName,
|  | [in] long | Type
| ) |  |

sets a new composed table name

Parameters

  ComposedName | specifies the composed table name
  Type | specifies the composition type which was used to create the composed table name

## Member Data Documentation

## ◆ CatalogName

string CatalogName
| attribute

denotes the name of the catalog which the table is a part of

## ◆ NameForSelect

string NameForSelect
| attribute readonly

represents the table name in a form to be used in a `SELECT` statement.

On a per-data-source basis, OpenOffice.org allows to override database meta data information in that you can specify to not use catalog and or schema names in `SELECT` statements. Using this attribute, you can generate a table name which respects those settings.

See also
  com::sun::star::sdb::DataSource::Settings

## ◆ SchemaName

string SchemaName
| attribute

denotes the name of the schema which the table is a part of

## ◆ Table

::com::sun::star::beans::XPropertySet Table
get raises | ( | com::sun::star::container::NoSuchElementException
| ) |  |
set raises | ( | com::sun::star::lang::IllegalArgumentException
| ) |  |
| attribute

is the com::sun::star::sdb::Table object specified by the current name.

Retrieving this attribute is equivalent to obtaining the tables container from the connection (via com::sun::star::sdbcx::XTablesSupplier), and calling its com::sun::star::container::XNameAccess::getByName() method with the ComposedName.

Exceptions

  com::sun::star::container::NoSuchElementException | if, upon getting the attribute value, the current composed table name represented by this instance does not denote an existing table in the database.
  com::sun::star::lang::IllegalArgumentException | if you try to set an object which does not denote a table from the underlying database.

## ◆ TableName

string TableName
| attribute

denotes the mere, unqualified table name, excluding any catalog and schema.

The documentation for this interface was generated from the following file:

- com/sun/star/sdb/tools/XTableName.idl