Board index » delphi » IB5 and Rational Rose

IB5 and Rational Rose

Hello,
I've been using Rational's Data Modeller extension to Rose, and when I
generated an sql scrip[t from my model, one of the commands in it for one of
my tables is:

CONSTRAINT RegionKey CHECK (CONSTRAINT fkrgn FOREIGN KEY (rgn_no) REFERENCES
Manager (rgn_no))

The problem is that IB5 won't parse this when I chose 'run SQL script' in
ISQL.
It throws up an error when it reaches the second 'CONSTRAINT' keyword
If I change it to simply;

CONSTRAINT fkrgn FOREIGN KEY (rgn_no) REFERENCES Manager (rgn_no)

it works.  It seems therefore that IB5 doesnt recognise a CONSTRAINT within
a CHECK.
Is there a way to create my foreign key within a check?
Kind regards,
George.

 

Re:IB5 and Rational Rose


Quote
George Francis wrote:

> Is there a way to create my foreign key within a check?

        No.  They are two separate entities.

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:IB5 and Rational Rose


"Craig Stuntz (TeamB)" <cstuntz@no_spam.vertexsoftware.com> wrote in message
news:3B320113.54C1862@no_spam.vertexsoftware.com...

Quote

> George Francis wrote:

> > Is there a way to create my foreign key within a check?

> No.  They are two separate entities.

> -Craig

Also, why then does Rational Rose's data modeller try to do just this?

Re:IB5 and Rational Rose


"Craig Stuntz (TeamB)" <cstuntz@no_spam.vertexsoftware.com> wrote in message
news:3B320113.54C1862@no_spam.vertexsoftware.com...

Quote

> George Francis wrote:

> > Is there a way to create my foreign key within a check?

> No.  They are two separate entities.

> -Craig

If I have my table in BCB5.0 represented by a TIBTable, is there a way to
retrieve the foreign key expression?  I really just want the name of the
table it refers to.
Thanks,
G.

Re:IB5 and Rational Rose


Quote
George Francis wrote:

> Also, why then does Rational Rose's data modeller try to do just this?

        Perhaps some other DB defines their constraints differently.  Different
DBs use different DDL grammars.  Anyway, you didn't expect a $2,500
drawing program to actually work, did you?  :)

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:IB5 and Rational Rose


Quote
George Francis wrote:

> If I have my table in BCB5.0 represented by a TIBTable, is there a way to
> retrieve the foreign key expression?  I really just want the name of the
> table it refers to.

1) Don't use TIBTable at all -- it's quite inefficient next to other IBX
datasets.
2) You can get the index a named constraint refers to from
RDB$REF_CONSTRAINTS.  From there you can get the relation name from
RDB$INDICES

        HTH,

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:IB5 and Rational Rose


"Craig Stuntz (TeamB)" <cstuntz@no_spam.vertexsoftware.com> wrote in message
news:3B324D63.BC0AFBF2@no_spam.vertexsoftware.com...

Quote

> George Francis wrote:

> > If I have my table in BCB5.0 represented by a TIBTable, is there a way
to
> > retrieve the foreign key expression?  I really just want the name of the
> > table it refers to.

> 1) Don't use TIBTable at all -- it's quite inefficient next to other IBX
> datasets.
> 2) You can get the index a named constraint refers to from
> RDB$REF_CONSTRAINTS.  From there you can get the relation name from
> RDB$INDICES

> HTH,

> -Craig

Sorry that this may be a basic question, but do I do this using calls to
DbiOpenTable()
or is there a way to do it using the Data Access Components of BCB5?

Re:IB5 and Rational Rose


Quote
George Francis wrote:

> Sorry that this may be a basic question, but do I do this using calls to
> DbiOpenTable()
> or is there a way to do it using the Data Access Components of BCB5?

        Personally, I'd recommend you go to:

http://codecentral.borland.com/codecentral/ccweb.exe/author?authorid=102

        ...and get version 4.6 of IBX for BCB.  You can then use a TIBSQL or
TIBDataset component to read this in.  If you must use the BDE, use a
TQuery.

        I would strongly recommend that you *not* call the BDE API directly.

        HTH,

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Other Threads