Sybase® Powerdesigner®
Total Page:16
File Type:pdf, Size:1020Kb
Data Modeling Sybase® PowerDesigner® 15.0 Windows Part number: DC38058-01-1500-01 Last modified: September 2008 Copyright © 2008 Sybase, Inc. and its subsidiaries. All rights reserved. Information in this manual may change without notice and does not represent a commitment on the part of Sybase, Inc. and its subsidiaries. Sybase, Inc. provides the software described in this manual under a Sybase License Agreement. The software may be used only in accordance with the terms of the agreement. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. and its subsidiaries. Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies. Sybase, SYBASE (logo), ADA Workbench, Adaptable Windowing Environment, Adaptive Component Architecture, Adaptive Server, Adaptive Server Anywhere, Adaptive Server Enterprise, Adaptive Server Enterprise Monitor, Adaptive Server Enterprise Replication, Adaptive Server Everywhere, Advantage Database Server, Afaria, Answers 365, Answers Anywhere, AppModeler, APT Workbench, APT-Build, APT-Edit, APT-Execute, APT-Translator, APT-Library, ASEP, Avaki, Avaki (Arrow Design), Avaki Data Grid, AvantGo, Bit-Wise, BizTracker, Certified PowerBuilder Developer, Certified SYBASE Professional, Certified SYBASE Professional Logo, CodeBank, Column Design, ComponentPack, Convoy/DM, Copernicus, CSP, Data Pipeline, DataArchitect, Database Analyzer, DataExpress, DataServer, DataWindow, DataWindow .NET, DB-Library, dbQueue, Dejima, Dejima Direct, Developers Workbench, DirectConnect Anywhere, DirectConnect, Distribution Director, Dynamic Mobility Model, e-ADK, e-Biz Integrator, EC Gateway, ECMAP, ECRTP, eFulfillment Accelerator, EII Plus, Embedded SQL, EMS, Enterprise Client/Server, Enterprise Connect, Enterprise Data Studio, Enterprise Manager, Enterprise Work Architecture, Enterprise Work Designer, Enterprise Work Modeler, eProcurement Accelerator, eremote, Everything Works Better When Everything Works Together, EWA, Extended Systems, ExtendedView, Financial Fusion, Financial Fusion (and design), Financial Fusion Server, Formula One, Fusion Powered e-Finance, Fusion Powered Financial Destinations, Fusion Powered STP, GeoPoint, GlobalFIX, iAnywhere, iAnywhere Solutions, ImpactNow, Industry Warehouse Studio, InfoMaker, Information Anywhere, InformationConnect, InphoMatch, InstaHelp, Intelligent Self-Care, InternetBuilder, iremote, iScript, Jaguar CTS, jConnect for JDBC, KnowledgeBase, Logical Memory Manager, M2M Anywhere, Mach Desktop, Mail Anywhere Studio, Mainframe Connect, Maintenance Express, Manage Anywhere Studio, MAP, M-Business Anywhere, MDI Access Server, MDI Database Gateway, media.splash, Message Anywhere Server, MetaWorks, MethodSet, mFolio, Mirror Activator, ML Query, MMS 365, Mobile 365 (and design), MobiLink, MySupport, New Era of Networks, Next Generation Learning, Next Generation Learning Studio, O DEVICE, OASiS, OASiS logo, ObjectConnect, ObjectCycle, OmniConnect, OmniQ, OmniSQL Access Module, OmniSQL Toolkit, OneBridge, Open Biz, Open Business Interchange, Open Client, Open ClientConnect, Open Client/Server, Open Client/Server Interfaces, Open Gateway, Open Server, Open ServerConnect, Open Solutions, OpenSwitch, Partnerships that Work, PB-Gen, PC APT Execute, PC DB-Net, PC Net Library, Pharma Anywhere, PhysicalArchitect, PocketBuilder, Power Through Knowledge, power.stop, PowerAMC, PowerBuilder, PowerBuilder Foundation Class Library, PowerDesigner, PowerDimensions, Powering the New Economy, PowerScript, PowerSite, PowerSocket, Powersoft, PowerStage, PowerTips, Powersoft Portfolio, Powersoft Professional, PowerWare Desktop, PowerWare Enterprise, ProcessAnalyst, Pylon, Pylon Anywhere, Pylon Application Server, Pylon Conduit, Pylon Pro, QAnywhere, RAP - The Trading Edition, Rapport, Relational Beans, RepConnector, Report Workbench, Report-Execute, Replication Agent, Replication Driver, Replication Server, Replication Server Manager, Replication Toolkit, Resource Manager, RFID Anywhere, RW-DisplayLib, RW-Library, SAFE, SAFE/PRO, Sales Anywhere, Search Anywhere, SDF, Search Anywhere, Secure SQL Toolset, Security Guardian, ShareSpool, Sharelink SKILS, smart.partners, smart.parts, smart.script, SOA Anywhere Trademark,SQL Advantage, SQL Anywhere, SQL Anywhere Studio, SQL Code Checker, SQL Edit, SQL Edit/TPU, SQL Modeler, SQL Remote, SQL SMART, SQL Toolset, SQL Station, SQLJ, Stage III Engineering, STEP, SupportNow, S.W.I.F.T. Message Format Libraries, Sybase 365, Sybase Central, Sybase IQ, Sybase Learning Connection, Sybase MPP, SyberLearning LIVE, SyberLearning OnDemand, Sybase SQL Desktop, Sybase SQL Lifecycle, Sybase SQL Workgroup, Sybase Synergy Program, Sybase Virtual Server Architecture, Sybase User Workbench, SybaseWare, Syber Financial, SyberAssist, SybFlex, SybMD, SyBooks, System 10, System 11, System XI (logo), SystemTools, Tabular Data Stream, The Enterprise Client/Server Company, The Extensible Software Platform, The Future Is Wide Open, The Learning Connection, The Model For Client/Server Solutions, The Online Information Center, The Power of One, TotalFix, TradeForce, Transact-SQL, Translation Toolkit, Turning Imagination Into Reality, UltraLite, UltraLiteJ, UltraLite.NET, UNIBOM, Unilib, Uninull, Unisep, Unistring, Unwired Accelerator, Unwired Orchestrator, URK Runtime Kit for UniCode, Unwired Accelerator, Unwired Orchestrator, Viafone, Virtualized Resource Management, VisualWriter, WarehouseArchitect, Warehouse Studio, Warehouse WORKS, Watcom, Watcom SQL, Web Deployment Kit, Web.PB, Web.SQL, WebSights, WebViewer, XA-Library, XA-Server, XcelleNet, XP Server, XTNDAccess, and XTNDConnect are trademarks of Sybase, Inc. or its subsidiaries. All other trademarks are the property of their respective owners. ii Contents I Building Data Models vii About This Manual ix 1 Getting Started with Data Modeling 1 Data Modeling with PowerDesigner . 2 Creating a Data Model . 5 2 Building Conceptual and Logical Diagrams 11 Introducing Conceptual and Logical Diagrams . 12 Conceptual Diagram Basics . 13 Logical Diagram Basics . 17 Data Items (CDM) . 21 Entities (CDM/LDM) . 24 Attributes (CDM/LDM) . 27 Identifiers (CDM/LDM) . 30 Relationships (CDM/LDM) . 32 Associations and Association Links (CDM) . 44 Inheritances (CDM/LDM) . 51 3 Building Physical Diagrams 57 Physical Diagram Basics . 58 Tables (PDM) . 62 Columns (PDM) . 86 Keys (PDM) . 95 Indexes (PDM) . 103 Defaults (PDM) . 111 Domains (CDM/LDM/PDM) . 115 Sequences (PDM) . 124 Abstract Data Types (PDM) . 129 References (PDM) . 138 Views (PDM) . 152 View References (PDM) . 169 Check Parameters (CDM/LDM/PDM) . 174 Business Rules (CDM/LDM/PDM) . 179 Physical Options . 188 iii 4 Building Multidimensional Diagrams 193 Multidimensional Diagram Basics . 194 Cubes (PDM) . 198 Dimensions (PDM) . 209 Attributes (PDM) . 211 Facts (PDM) . 214 Measures (PDM) . 216 Hierarchies (PDM) . 218 Associations (PDM) . 220 5 Building Triggers and Procedures 223 Triggers (PDM) . 224 Trigger Templates (PDM) . 240 Trigger Template Items (PDM) . 248 Stored Procedures and Functions (PDM) . 255 Procedure Templates (PDM) . 266 SQL Code Definition Toolbars . 270 Creating SQL/XML Queries with the Wizard . 271 Generating Triggers and Procedures . 275 6 Building a Database Access Structure 281 Introducing database access . 282 Users (PDM) . 283 Roles (PDM) . 298 Groups (PDM) . 300 Synonyms (PDM) . 302 7 Building Web Services 309 Introducing Web Services . 310 Web Services (PDM) . 311 Web Operations (PDM) . 316 Web Parameters (PDM) . 321 Testing Web Services . 323 Generating Web Services . 324 Reverse Engineering Web Services . 328 8 Working with Data Models 331 Customizing the Data Modeling Environment . 332 Generating Other Models from a Data Model . 370 Checking a Data Model . 381 Working with SQL . 426 iv II Working with Databases 433 9 Generating a Database from a PDM 435 Connecting to a Database . 436 Generating a Database . 438 Using Test Data . 472 Estimating Database Size . 500 Modifying a Database . 506 Accessing a Database . 513 10 Reverse Engineering a Database into a PDM 515 Getting Started with Reverse Engineering . 516 Reverse Engineering from Scripts . 517 Reverse Engineering from a Live Database . 520 Reverse Engineering Options . 524 Reverse Engineering Database Statistics . 532 11 DBMS-Specific Features 535 Working with PowerDesigner’s DBMS-Specific Features . 536 IBM DB2 for z/OS (formerly OS/390) . 537 IBM DB2 for Common Server . 542 Informix SQL . 549 Ingres . 550 Interbase . 551 Microsoft Access . 552 Microsoft SQL Server . 553 MySQL . 617 NonStop SQL . 619 Oracle . 620 PostgreSQL . 643 Red Brick Warehouse . 648 Sybase AS Anywhere . 649 Sybase AS Enterprise . 655 Sybase AS IQ . 659 Sybase SQL Anywhere . 674 Teradata . 678 12 Writing SQL Statements in PowerDesigner 687 Introduction . 688 Writing SQL with the PowerDesigner GTL . 689 Writing SQL with the PDM Variables and Macros . 691 PDM Macros . 693 PDM Variables . 704 PowerDesigner Formatting Variables . 716 v 13 Migrating from ERwin to PowerDesigner 717 Introducing the ERwin Import Process . 718 Preparing to Import your ERwin models . 720 The Import Process . 721 After Importing . 723 Getting Started Using PowerDesigner . 728 Index 731 vi PART I BUILDING DATA MODELS This part explains how to use PowerDesigner to build Data Models.