Re: Check for index existence before creation
Posted in 2000
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
From: "Neil Truby" <ntruby@netcomuk.co.uk>
>
>Can't you just query the sysindexes table?
>
>Low Kit Ming <kmlow72@hotmail.com> wrote in message
>news:3A03DE47.409D7E47@hotmail.com...
>Hi all,
>I'm writing an ESQL/C code to create indexes for tables using the following
>Create Index command:
> ...
> $CREATE UNIQUE INDEX pg_idx ON pg (devicetype,id1,id2,id3,id4);> ...
>But, before creating the index, I would like to check whether the index was
>created. If the target index was created then skip the index creation. My
>question is how to check whether the index was created in ESQL/C code?
>What
>in my mind now is to ignore the created error if any as below:
> ...
> $CREATE UNIQUE INDEX pg_idx ON pg (devicetype,id1,id2,id3,id4);
> if (sqlca.sqlcode)
>
>
> cout << "Error creating index on pg: " << " Ignoring. " <<
>sqlca.sqlcode << endl;
> }
>Please advise. Thanks.
The easiest way
Is what you already think...
Two minds so alike
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
"Obnoxio The Clown" <obnoxio@hotmail.com> wrote in message news:8u60b9$k04$1@news.xmission.com... > > From: "Neil Truby" <ntruby@netcomuk.co.uk> > > > >Can't you just query the sysindexes table? > Two minds so alike You two think alike? Ok, now I am afraid!