Subject | Re: [firebird-support] Create Database Process |
---|---|
Author | Ann W. Harrison |
Post date | 2005-01-28T17:00:31Z |
With the exception of gstat which reads the database file directly to
gather its statistics, all the Firebird utilities use api calls to do
their work. So anything you can do with ISQL, you can do with the API -
some things require a bit more code (e.g. SHOW translates to API calls
to return data from system tables) and some aren't worth doing (e.g. SET
TERM)
Firebird has two levels of API, the DSQL API and the lower-level blr
(binary language representation) API. A layer at the server converts
the DSQL API to blr for execution. So, anything you can do in the DSQL
API, you can do - with some amount of work - at the blr level.
In the DSQL API, you create a database with the execute immediate call
and a SQL string of CREATE DATABASE ... or CREATE SCHEMA. The blr
equivalent is isc_create_database. Borland suppressed documentation of
isc_create_database - too dangerous, I guess, because the DSQL
version won't overwrite an existing file - the DSQL layer checks before
calling isc_create_database.
Following a successful CREATE DATABASE or isc_create_database, the
application has a connection to the newly created database.
Regards,
Ann
gather its statistics, all the Firebird utilities use api calls to do
their work. So anything you can do with ISQL, you can do with the API -
some things require a bit more code (e.g. SHOW translates to API calls
to return data from system tables) and some aren't worth doing (e.g. SET
TERM)
Firebird has two levels of API, the DSQL API and the lower-level blr
(binary language representation) API. A layer at the server converts
the DSQL API to blr for execution. So, anything you can do in the DSQL
API, you can do - with some amount of work - at the blr level.
In the DSQL API, you create a database with the execute immediate call
and a SQL string of CREATE DATABASE ... or CREATE SCHEMA. The blr
equivalent is isc_create_database. Borland suppressed documentation of
isc_create_database - too dangerous, I guess, because the DSQL
version won't overwrite an existing file - the DSQL layer checks before
calling isc_create_database.
Following a successful CREATE DATABASE or isc_create_database, the
application has a connection to the newly created database.
Regards,
Ann