To query or update data in an Adabas database, you must create
a relational table that maps to that database. You can also create a view
on the table. You use the New Adabas Table wizard to create a table and a
view.
Show
me!
Before you begin
- Configure the data server where you plan to run the query processor that
will accept requests from client applications.
- Create a metadata catalog.
- Decide which data structures to map in your database and plan the indexes
that you will need. To ensure optimal performance, you must map the underlying
data correctly. This task includes ensuring that any indexes, keys, or units
of data that are defined in your database are defined to the data server when
you map the data. Almost any column that maps to a field definition table
(FDT) or special descriptor table (SDT) definition can be used for an index.
- Configure a connection between the data server and your Adabas database.
- If you want to use Predict, know the Adabas file number of the Predict
dictionary and the name of the view that you want to map to. If you are not
using Predict, know the number of the Adabas file that you want to map to.
Restrictions
- Each column in the table that you create must be associated with a field
in the file, a superdescriptor, or a subdescriptor.
- If Predict formatting is available, the following Predict formats are
supported:
- character (A,AL,AV)
- binary (B) with length of 2 or 4
- date (D, DS, DT)
- floating point (F)
- integer (I)
- logical (L)
- numeric packed and unpacked (N, NS, P, PS, U, US)
- time (T, TS)
If only Adabas field formatting is available, the following formats are
supported:- alphanumeric (A)
- binary (B) with length of 2 or 4
- fixed point (F)
- floating point (G)
- packed decimal (P) and unpacked decimal (U)
About this task
For
more information about creating tables and views that map to Adabas databases,
see the related links for Adabas syntax diagrams and for views.
Procedure
To create an Adabas table and optionally a
view for Classic federation:
- Optional: Use the Adabas page of the Preferences window
to set these default values:
- The name of the Predict dictionary that you want to use.
- The date format that Classic Data Architect should convert dates to.
- The time format that Classic Data Architect should convert times to.
- The maximum length for VARCHAR data.
- The maximum length for LVARCHAR data.
- The maximum number of occurrences for all fields that occur multiple times
in an Adabas file.
- Whether to use the User Synonym field from the Predict Dictionary when
this field is defined.
- Map your Adabas database to a relational table by using the New
Adabas Table wizard.
- Open this wizard by right-clicking either the database in your
data design project or one of the schemas within the database. Select Add
Classic Object > Adabas table.
- Select the model and schema in which you want to create the
table.
- Choose whether or not to create a view on the table.
- Choose whether to connect to your Adabas database through an
existing connection to a data server or whether you want to create a new connection
to a data server. Either data server must be configured to access
the Adabas database.
- Specify the format of dates and times, the lengths of VARCHAR
and LVARCHAR data types, and the maximum number of occurs. The
default values that appear are either the global defaults that are set for
the Adabas database or the defaults that are set in the Adabas page
of the Preferences window.
- Specify whether you plan to use the table (and view, if you
are creating one) for queries, updates, or both.
- Provide either the Predict or Adabas information that is necessary
for the discovery process.
- Select the Adabas fields that you want to map to columns in
your relational table.
- If you are creating a view, specify the criteria for the WHERE
clause.
- Modify the names of columns and provide null values.
When you finish the wizard, the new table appears under the selected
schema. If you created a view, it also appears under the selected schema.
- Optional: Modify the table properties or add privileges.
Select the table, and make any changes in the Properties view.
- Optional: Generate the DDL for the table. You
can generate the DDL later, if you do not want to generate it now. You can
also generate the DDL for all of the objects within the same schema. See Generating DDL.
- Right-click the table and select Generate DDL.
- In the Generate DDL wizard, follow these steps:
- Choose to generate CREATE statements.
- Choose to generate DDL for tables.
- Name the file in which to save the DDL within your project.
- Choose whether to run the DDL on a data server. After you run the DDL,
check the Data Output view to determine if the DDL ran successfully.
- Choose whether to open the DDL for editing.
- Optional: If you ran the DDL successfully on a data
server, validate the table by running a test query against your Adabas database.
Be sure that the data server is connected to that database.
- In the Database Explorer, search your data server for the schema
that you created the table in. Expand the schema and expand the Tables folder.
- Right-click the table and select Data > Sample
Contents.
- Check the Data Output view to determine whether the test query
ran successfully.
- Optional: If you created a view, you can generate the
DDL for the view now or later. You can also generate a DDL for
all of the objects within the same schema. See Generating DDL.
- Right-click the view and select Generate DDL.
- In the Generate DDL wizard, follow these steps:
- Choose to generate CREATE and ALTER statements.
- Choose to generate DDL for views.
- Name the file in which you want to save the DDL within your project.
- Choose whether to run the DDL on a data server. After running the DDL,
check the Data Output view to find out whether the DDL ran successfully.
- Choose whether you want to open the DDL for editing.
- Optional: If you ran the DDL successfully on a data
server, validate the view by running a test query against your Adabas database.
Be sure that the data server is connected to that database.
- In the Database Explorer, search your data server for the schema
that you created the view in. Expand the schema and expand the Views folder.
- Right-click the view and select Data > Sample
Contents.
- Check the Data Output view to determine whether the test query
ran successfully.