PK
.Aoa, mimetypeapplication/epub+zipPK .A iTunesMetadata.plistV
Object Browser enables developers to browse, create, and edit objects in a database.
This section contains the following topics:
The Object Browser page is divided into two sections:
Object Selection pane displays on the left side of the Object Browser page and lists database objects of a selected type within the current schema. You can further narrow the results by filtering on the object name.
Detail pane displays to the right of the page and displays detailed information about the selected object. To view object details, select an object in the Object Selection pane. Click the tabs at the top of the Detail pane to view additional details about the current object. To edit an object, click the appropriate button.
Selecting a Schema
A schema is a logical container for database objects. To access objects in another schema, make a selection from the Schema list in the upper right side of the page.
Switching to Another SQL Workshop Component
You can navigate to another SQL Workshop component by selecting from the Component list located on the upper right side of the page:
Object Browser. See "Managing Database Objects with Object Browser".
SQL Commands. See "Using SQL Commands".
SQL Scripts. See "Using SQL Scripts".
Query Builder. See "Building Queries with Query Builder".
To access Object Browser:
Log in to the Workspace home page.
Click SQL Workshop.
To view Object Browser you can either:
Click SQL Workshop and then Object Browser to drill-down to the Object Browser.
Click the down arrow on the right side of the SQL Workshop icon to view a drop down menu. Then select the Object Browser menu option.
Note: For the purposes of consistency, this document uses the primary navigation path (or drill-down approach) when explaining navigation. |
The Object Selection pane displays on the left side of the Object Browser page and lists database objects by type with the current schema. You can filter the view by selecting an object type or entering a case insensitive search term.
Topics in this section include:
To search for a database object in the Object Selection pane:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
Select an object type from the Object list.
The list of objects that appears depends upon the available objects in the current schema. Note that any object having a red bar adjacent to it is invalid.
To search for an object name, enter a case insensitive search term in the Search field.
To view all objects, leave the search field blank.
Once you locate the database object you want to view, simply select it. The selected object displays in the Detail pane. If no object is selected, the Detail pane is blank.
You can hide the Object Selection pane by selecting the Hide Objects control. This control displays on the right side of the Object Selection pane. If the Object Selection pane appears, selecting this control hides it. Similarly, if the Object Selection pane is hidden, selecting this control causes the pane to reappear.
The Find Tables icon resembles a flashlight. Click this icon to view tables within the currently selected schema.
To view tables within the current schema:
Navigate to either Object Browser or SQL Commands.
From the Schema list, select a schema (optional).
Click the Find Tables icon.
The Table Finder appears. A search bar displaying the selected schema displays at the top of the page and contains the following controls:
Search. Search for a table name. Enter case insensitive keywords in the Search field and click Go. To view all tables, leave the Search field blank and click Go.
Rows. Determine how many rows display in the resulting report. To change the number of rows that display, make a selection from the list and click Go.
Views. Select the Views check box and click Go to include views in the resulting report.
The Table Finder report appears displaying the table name, the number of rows, last analyzed date, and the object type.
Select a table name.
A table definition appears on the right side of the page.
This report displays the column names, data type, length, precision, scale and the SQL necessary to re-create the table that appears at the bottom of the page.
You can create database objects using the Create Database Object Wizard. Once you select an object, a set of tabs and buttons appears at the top of the Detail pane. Use the tabs to view different aspects of the current items (for example, a tables indexes). Use the buttons to modify the current object.
To create an object:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
Click Create, located in the upper right corner of the Detail pane.
From the list of object types, select the type of object you want to create.
Follow the on-screen instructions.
A table is a unit of data storage in an Oracle database, containing rows and columns. When you view a table in Object Browser, a table description appears that describes each column in the table.
Topics in this section include:
See Also:
|
To create a table:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
Click Create.
From the list of object types, select Table.
Enter a table name.
Table names must conform to Oracle naming conventions and not contain spaces or start with a number or underscore.
To have the final table name match the case entered in the Table Name field, click Preserve Case.
Enter details for each column. For each column:
Enter the column name.
Select the column type. Available types include NUMBER, VARCHAR2, DATE, TIMESTAMP, CHAR, CLOB, BLOB, NVARCHAR2, BINARY_FLOAT, and BINARY_DOUBLE
Enter the following additional information as appropriate:
Precision
Scale
To specify a column should not be NULL, select the check box in the Not Null column.
To change the order of previously entered columns, click the Up and Down arrows in the Move column. To add additional columns, click Add Column.
Click Next.
Next, define the primary key for this table (optional). A primary key is a single field or combination of fields that uniquely identifies a record.
For Primary Key, select the appropriate option and click Next:
No Primary Key - No primary key is created.
Populated from a new sequence - Creates a primary key and creates a trigger and a sequence. The sequence is used in the trigger to populated the selected primary key column. The primary key can only be a single column.
Populated from an existing sequence - Creates a primary key and creates a trigger. The selected sequence is used in the trigger to populate the selected primary key column. The primary key can only be a single column.
Not populated - Defines a primary key but does not have the value automatically populated with a sequence within a trigger. You can also select this option to define a composite primary key (that is, a primary key made up of multiple columns).
Next, add foreign keys (optional). A foreign key establishes a relationship between a column (or columns) in one table and a primary or unique key in another table.
To add a foreign key:
Name - Enter a name of the foreign key constraint that you are defining.
Select Key Column(s) - Select the columns that are part of the foreign key, then click the Add icon to move them to Key Column(s).
References Table - Select the table which is referenced by this foreign key. Then, select the columns referenced by this foreign key. Once selected, click the Add icon to move the selected columns to Referenced Column(s).
Select the appropriate option:
Disallow Delete - Blocks the delete of rows from the referenced table when there are dependent rows in this table.
Cascade Delete - Deletes the dependent rows from this table when the corresponding parent table row is deleted.
Set to Null on Delete - Sets the foreign key column values in this table to null when the corresponding parent table row is deleted.
Click Add.
Click Next.
Next, add a constraint (optional). You can create multiple constraints, but you must add each constraint separately.
To add a constraint:
Specify the type of constraint (Check or Unique).
A check constraint is a validation check on one or more columns within the table. No records can be inserted or updated in a table which violates an enabled check constraint. A unique constraint designates a column or a combination of columns as a unique key. To satisfy a unique constraint, no two rows in the table can have the same values for the specified columns.
Enter the constraint in the field provided. For unique constraints, select the column(s) that are to be unique. For check constraints, enter the expression that should be checked such as flag in ('Y','N')
.
Click Add.
Click Finish.
A confirmation page appears. To view the SQL used to create the table, click SQL Syntax.
Click Create.
Note that it is not necessary to follow the steps for creating a table in the order described in the previous procedure. Instead of navigating through the wizard by clicking the Next and Previous button, you can also access a specific step by selecting it in the progress indicator on the left side of the page.
See Also: "Using the Table Finder" in Oracle Application Express Application Builder User's Guide and "Overview of Tables" in Oracle Database Concepts for information about tables. |
When you view a table in Object Browser, the table description appears. While viewing this description, you can add a column, modify a column, rename a column, drop a column, rename the table, copy the table, drop the table, truncate the table, or create a lookup table based upon a column in the current table. Additionally, you have access other reports that offer related information including the table data, indexes, data model, constraints, grants, statistics, user interface defaults, triggers, dependencies, and SQL to produce the selected table.
To view a table description:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
From the Object list, select Tables.
From the Object Selection pane, select a table.
The table description appears.
Click the tabs at the top of the page to view different reports about the table. Table 1-1 describes all available views.
Table 1-1 Available Views for Tables
View | Description |
---|---|
Table |
Displays details of the first 31 columns including the column name, data type, nullable status, default value, and primary key. While viewing table details you can add, modify, delete, or rename a column. Additionally, you can drop, rename, copy, or truncate the table only if the referencing table has no records and create a lookup table. To export the data as a comma-delimited file (.csv) file, click the Download link. See Also: "Editing a Table" |
Data |
Displays a report of the data in the current table. Actions you can perform include:
|
Indexes |
Displays indexes associated with this table. Actions you can perform include Create and Drop. See Also: "Managing Indexes" |
Model |
Displays a graphical representation of the selected table along with all related tables. Related tables are those that reference the current table in a foreign key and those tables referenced by foreign keys within the current table. You can position the cursor over an underlined table name to view the relationship between that table and the current table. Click an underlined table name to view the model of the related table. |
Constraints |
Displays a list of constraints for the current table. Actions you can perform include Create, Drop, Enable, and Disable. |
Grants |
Displays a list of grants on the current table, including the grantee, the privilege, and grant options. Actions you can perform in this view include Grant and Revoke. |
Statistics |
Displays collected statistics about the current table, including the number of rows and blocks, the average row length, sample size, when the data was last analyzed, and the compression status (enabled or disabled). Click Analyze to access the Analyze Table Wizard. |
UI Defaults |
Displays user interface defaults for forms and reports. User interface defaults enable developers to assign default user interface properties to a table, column, or view within a specified schema. Click Edit to edit defined user interface defaults. Click Create to initialize user interface defaults for tables that do not currently have user interface defaults defined. See Also: "Managing User Interface Defaults" in Oracle Application Express Application Builder User's Guide. |
Triggers |
Displays a list of triggers associated with the current table. Actions you can perform include Create, Drop, Enable, and Disable. To view trigger details, click the trigger name. See Also: "Managing Triggers" |
Dependencies |
Displays report showing objects referenced by this table, objects this table references, and synonyms for this table. |
SQL |
Displays the SQL necessary to re-create this table, including keys, indexes, triggers and table definition. |
While viewing a table description, you can edit it by clicking the buttons above the table description.
To edit a table:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
From the Object list, select Tables.
From the Object Selection pane, select a table.
The table description appears.
Click the appropriate button described in Table 1-2.
Table 1-2 Edit Table Buttons
Button | Description |
---|---|
Adds a column to the table. Enter a column name and select a type. Depending upon the column type, specify whether the column requires a value, the column length, precision, and scale. | |
Modifies the selected column. | |
Renames the selected column. | |
Drops the selected column. | |
Renames the selected table. | |
Copies the selected table. | |
Drop |