Subject | Re: [ib-support] Re: Indexs! |
---|---|
Author | Dave Wallace |
Post date | 2002-10-01T14:04:44Z |
Because I thought the index names were ugly & unclear, I just create the
index and it's name in code.
This works, I look in RDB$INDICES and my indexes are named as expected
Hope this helps Cheers - Dave
function build_XXX : Boolean;
begin
Result := True;
ib_progressDetail('Creating new XXX Table', showlist);
with dm.IBOQuery do
begin
try
Close;
SQL.Clear;
SQL.Add('DROP TABLE "XXX"');
ExecSQL;
except
end;
try
Close;
SQL.Clear;
SQL.Add('CREATE TABLE "XXX" (');
SQL.Add('XXXNAME varchar(32) not null,');
SQL.Add('XXXNOTE fsz_memo)');
ExecSQL;
except
ib_progressError('Create XXX Table failed', showlist);
end;
try
ib_progressDetail('Index XXX Table', showlist);
Close;
SQL.Clear;
SQL.Add('CREATE UNIQUE INDEX XXX ON XXX (XXXNAME)');
ExecSQL;
except
ib_progressError('Index XXXNAME key failed', showlist);
end;
end;
end;
Andrew wrote:
[Non-text portions of this message have been removed]
index and it's name in code.
This works, I look in RDB$INDICES and my indexes are named as expected
Hope this helps Cheers - Dave
function build_XXX : Boolean;
begin
Result := True;
ib_progressDetail('Creating new XXX Table', showlist);
with dm.IBOQuery do
begin
try
Close;
SQL.Clear;
SQL.Add('DROP TABLE "XXX"');
ExecSQL;
except
end;
try
Close;
SQL.Clear;
SQL.Add('CREATE TABLE "XXX" (');
SQL.Add('XXXNAME varchar(32) not null,');
SQL.Add('XXXNOTE fsz_memo)');
ExecSQL;
except
ib_progressError('Create XXX Table failed', showlist);
end;
try
ib_progressDetail('Index XXX Table', showlist);
Close;
SQL.Clear;
SQL.Add('CREATE UNIQUE INDEX XXX ON XXX (XXXNAME)');
ExecSQL;
except
ib_progressError('Index XXXNAME key failed', showlist);
end;
end;
end;
Andrew wrote:
> In regard to giving PK/FK indexes meaningful names:...
>
> There was a workaround for this -- I remember trying it when I first
> came to Firebird, and it worked great. I think it was trigger-based
> and involved modifying a system table. Unfortunately, that was
[Non-text portions of this message have been removed]