24.12.2012 Views

ER/Studio - Embarcadero Technologies Product Documentation

ER/Studio - Embarcadero Technologies Product Documentation

ER/Studio - Embarcadero Technologies Product Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

USING <strong>ER</strong>/STUDIO > DEVELOPING THE PHYSICAL MODEL<br />

Notes<br />

• You can choose to launch your preferred SQL editor when editing functions and procedures. Using the Tools tab<br />

of the Options Editor, you can enter the name and location of the SQL editor that will launch and manage the SQL<br />

<strong>ER</strong>/<strong>Studio</strong> outputs. Click Tools > Options > Tools > ISQL Path.<br />

• For all new models you can choose:<br />

• To display the schema object description or its associated symbol; click Tools > Options > Display and then<br />

select the desired display mode.<br />

• To hide invalid schema objects; click Tools > Options > Schema Objects and then select Hide Invalid Schema<br />

Object Bitmap.<br />

• For the current data model, you can choose:<br />

• To display the schema objects or objects relationships, and object definition or object symbol; click View ><br />

Diagram And Object Display Options > Schema Object and then select the desired display options.<br />

• What to display when you mouse over a schema object; click Tools > Options > Diagram > Schema Object<br />

Display and choose to display the object description or its associated DDL.<br />

• For physical models, you can enter SQL to be applied before and after the CREATE OBJECT clause in the<br />

CREATE TABLE statement. Click Model > Model Properties > PreSQL & Post SQL.<br />

• The sample physical model for SQL Server 200 in Northwindl.dm1 provides some good examples of how SQL<br />

procedures can be used.<br />

Import an SQL Procedure<br />

1 In the Data Model Explorer, expand the Physical Main Model, right-click the Procedures node, and then click<br />

New Procedure.<br />

2 On the Description tab, click Import and then type, or browse to and then select the name of SQL procedure file<br />

you want to import.<br />

3 Complete the Procedure SQL Editor and then click OK to create the procedure.<br />

Export an SQL Procedure<br />

1 In the Data Model Explorer, expand the Physical Main Model, right-click the Procedures node, and then click<br />

New Procedure.<br />

2 On the Description tab, click Export and then type, or browse to and then select the name of the SQL procedure<br />

file name where you want to save the SQL procedure.<br />

3 Complete the Procedure SQL Editor and then click OK to create the procedure.<br />

Creating and Editing Triggers<br />

Triggers are code objects associated with a table that automatically execute when the table is modified by an SQL<br />

INS<strong>ER</strong>T, UPDATE, or DELETE statement. Triggers can contain complex SQL statements, such as those required to<br />

query other tables, but cannot accept parameters or arguments, and cannot perform commit or rollback operations.<br />

They are also subject to coding errors like every other script or application.<br />

EMBARCAD<strong>ER</strong>O TECHNOLOGIES > <strong>ER</strong>/STUDIO® 8.0.3 US<strong>ER</strong> GUIDE 186

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!