To open the Database painter, click the Database button in the PowerBar.
Like the other PocketBuilder painters, the Database painter contains a menu bar, a customizable PainterBar, and several views. All database-related tasks that you can do in PocketBuilder can be done in the Database painter.
UltraLite limitations UltraLite databases do not support database owners, groups, stored procedures, views, system tables, and extended attributes, and you cannot modify tables and primary and foreign keys in the database directly. As a result, some of the Database painter views are read only, some tree view items are not present or empty, and some menu items are disabled when you are connected to an UltraLite database. Use the UltraLite Schema Painter, available in the UltraLite Utilities folder in the Database painter’s Objects view, to modify tables.
Table 16-1 lists the views available in the Database painter.
View |
Description |
---|---|
Activity Log |
Displays the SQL syntax generated by the actions you execute. |
Columns |
Used to create and/or modify a table’s columns. The Columns view is read only for UltraLite databases. |
Extended Attributes |
Lists the display formats, edit styles, and validation rules defined for the selected database connection. Extended attributes are not supported in UltraLite databases. |
Interactive SQL (ISQL Session) |
Used to build, execute, or explain SQL. |
Object Details |
Displays an object’s properties. For some objects, its properties are read-only; for others, properties can be modified. This view is analogous to the Properties view in other painters. |
Object Layout |
Displays a graphical representation of tables. |
Objects |
Lists the database interfaces and profiles. For an active database connection, might also list all or some of the following objects associated with that database: groups, metadata types, procedures and functions, tables, columns, primary and foreign keys, indexes, users, views, driver information, and utilities (the database components listed depend on the database and your user privileges). |
Results |
Displays data in a grid, table, or freeform format. |
Figure 16-2: Default layout of the Database painter
You can select certain database objects from the Objects view and drag them to the Object Details, Object Layout, Columns, and/or ISQL views. Position the pointer on the database object’s icon and drag it to the appropriate view.
Object |
Can be dragged to |
---|---|
Driver, group, metadata type, procedure or function, table, column, user, primary or foreign key, index |
Object Details view |
Table or view |
Object Layout view |
Table or column |
Columns view |
Procedure or view |
ISQL view |
Table 16-3 describes how to do some basic tasks in the Database painter. Most of these tasks begin in the Objects view. Many can be accomplished by dragging and dropping objects into different views. If you prefer, you can use buttons or menu selections from the main bar or from pop-up menus.
To do this |
Do this |
---|---|
Modify a database profile |
Highlight a database profile and select Properties from the Object or pop-up menu, or use the Properties button. You can use the Import and Export Profiles menu selections to copy profiles. For more information, see the chapter on connecting to a database in the Resource Guide. |
Connect to a database |
Highlight a database profile and then select Connect from the File or pop-up menu or use the Connect button. With File>Recent Connections you can review and return to earlier connections. Database connections can also be made using the Database Profile button. |
Create new profiles, tables, views, columns, keys, indexes, or groups |
Highlight the database object and select New from the Object or pop-up menu or use the Create button. |
Modify database objects |
Drag the object to the Object Details view. |
Graphically display tables |
Drag the table icon from the list in the Objects view to the Object Layout view, or highlight the table and select Add To Layout from the Object or pop-up menu. |
Manipulate data |
Highlight the table and select Grid, Tabular, or Freeform from the Object>Data menu or the pop-up menu Edit Data item, or use the appropriate Data Manipulation button. |
Build, execute, or explain SQL |
Use the ISQL view to build SQL statements. Use the Paste SQL button to paste SELECT, INSERT, UPDATE, and DELETE statements, or type them directly into the view’s scripting area. To execute or explain SQL, select Execute SQL and Explain SQL from the Design or pop-up menu. |
Define or modify extended attributes |
Select from the Object>Insert menu the type of extended attribute you want to define or modify, or highlight the extended attribute from the list in the Extended Attributes view and select New or Properties from the pop-up menu. |
Specify extended attributes for a column |
Drag the column to the Object Details view and select the Extended Attributes tab. |
Access database utilities |
Double-click a utility in the Objects view to launch it. |
Log your work |
Select Design>Start Log from the menu bar. To see the SQL syntax generated, display the Activity Log view. |