Switch to standard view 
  Sybase logo
 
 
 



In Adaptive Server Anywhere 7, ASA7, you can now generate the ASE special IDENTITY column.
By default, PowerDesigner generates AUTOINCREMENT columns for ASA7. By modifying the
ASA7 XDB file in PowerDesigner 7.x, you can generate DDL for the IDENTITY column.

NOTE: When modifying the XDB files, it is HIGHLY RECOMMENDED that you make a backup of the source file.

In this example, we will create a new XDB for ASA7.

1) Select DBMS from the Tools>Resources menu

2) Click the New icon

3) Enter a new name for the XDB file, Sybase AS Anywhere 7 Identity

4) Select Sybase AS Anywhere 7 in the Copy From listbox

5) In the DBMS Editor, navigate to the "Add" item in the Script>Object>Column folder

6) Change the default syntax of the Add item from:

%20:COLUMN% %30:DATATYPE%[%NOTNULL%][%IDENTITY%? default autoincrement:[default %DEFAULT%]]
[check (%CONSTRAINT%)]

to

%20:COLUMN% %30:DATATYPE%[%IDENTITY%? IDENTITY][ %NOTNULL%][default %DEFAULT%]
[check (%CONSTRAINT%)]

%Variable Name%? is PowerDesigner's way of implementing IF..THEN..ELSE logic
In this case, %IDENTITY%? will now generate IDENTITY specific DDL instead of AUTOINCREMENT
specific DDL when the identity option is selected on a column. If the identiy option is not selected
on a column, then the IDENTITY specific DDL will be ignored.

7) Click OK and specify a file name for your new XDB file.

Now when you generate an identity column from a PDM targetting ASA 7, the following DDL
will be generated:
 

/*==============================================================*/
/* Table : TABLE_1                                              */
/*==============================================================*/
create table TABLE_1
(
   COLUMN_1             numeric(10)        IDENTITY not null,
   COLUMN_2             CHAR(10),
   COLUMN_3             CHAR(10),
   primary key (COLUMN_1)
);

<<DDL script from PDM linked to "Sybase AS Anywhere 7 Identity" DBMS>>

Instead of

/*==============================================================*/
/* Table : TABLE_1                                              */
/*==============================================================*/
create table TABLE_1
(
   COLUMN_1             numeric(10)      not null default autoincrement,
   COLUMN_2             CHAR(10),
   COLUMN_3             CHAR(10),
   primary key (COLUMN_1)
);

<<DDL script from PDM linked to "Sybase AS Anywhere 7" DBMS>>



Back to Top
© Copyright 2010, Sybase Inc.