Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Reading the Index Properties

2 posts in Visual Basic Last posting was on 2007-11-10 00:52:06.0Z
Jeffrey Bovee Posted on 2007-11-08 21:46:00.0Z
Reply-To: "Jeffrey Bovee" <jbovee@runwithmustang.com>
From: "Jeffrey Bovee" <jbovee@runwithmustang.com>
Newsgroups: advantage.visual_basic
Subject: Reading the Index Properties
Date: Thu, 8 Nov 2007 16:46:00 -0500
Lines: 13
Organization: Mustang Computer Specilists, Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
NNTP-Posting-Host: 68.32.89.32
Message-ID: <473382ca@solutions.advantagedatabase.com>
X-Trace: 8 Nov 2007 14:42:34 -0700, 68.32.89.32
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!68.32.89.32
Xref: solutions.advantagedatabase.com Advantage.Visual_Basic:1143
Article PK: 1137934

This is probably not a 'visual basic' question, but I couldn't find a
category that seemed to fit.

I'm trying to read in the index of a table if, and only if, the index is
unique. Using the 'Select * from system.indexes', I can get get information
on the index. I know the Index_Options field seems to hold the information
I want and it seems like the '2 bit' is what's set if the field is unique,
but I need to know exactly what values comes up in that field and which
options affect the value that is returned.

Can someone help me?


Mark Wilkins Posted on 2007-11-10 00:52:06.0Z
From: "Mark Wilkins" <mark@no.email>
Newsgroups: advantage.visual_basic
References: <473382ca@solutions.advantagedatabase.com>
Subject: Re: Reading the Index Properties
Date: Fri, 9 Nov 2007 17:52:06 -0700
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.228
Message-ID: <4734ff7a@solutions.advantagedatabase.com>
X-Trace: 9 Nov 2007 17:46:50 -0700, 10.24.38.228
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.228
Xref: solutions.advantagedatabase.com Advantage.Visual_Basic:1148
Article PK: 1137941

Hi Jeffrey,

I think it is the lowest bit (1) that you want to look at for determining if
the index is unique. The current possible values for those options are the
same as the possible options that can be used in the API call
(AdsCreateIndex) that creates the index. The current bits that can be set
are the following (copied from the ace.h C/C++ header file). These do not
include options that could be set for an FTS index.

#define ADS_UNIQUE 0x00000001
#define ADS_COMPOUND 0x00000002
#define ADS_CUSTOM 0x00000004
#define ADS_DESCENDING 0x00000008
#define ADS_USER_DEFINED 0x00000010
#define ADS_NOT_AUTO_OPEN 0x00000400 // Don't make this an auto
open index in data dictionary

In practice, the bits most commonly used for "typical" indexes will be the
unique, compound, and descending options. But I don't think you want to
make the application rely on those being the only bits. For example, in the
next release there will be another bit set if it is a candidate index. The
best thing would be to do a bitmask operation and examine just the bit/bits
of interest.

Mark Wilkins
Advantage R&D

"Jeffrey Bovee" <jbovee@runwithmustang.com> wrote in message
news:473382ca@solutions.advantagedatabase.com...
> This is probably not a 'visual basic' question, but I couldn't find a
> category that seemed to fit.
>
> I'm trying to read in the index of a table if, and only if, the index is
> unique. Using the 'Select * from system.indexes', I can get get
> information on the index. I know the Index_Options field seems to hold
> the information I want and it seems like the '2 bit' is what's set if the
> field is unique, but I need to know exactly what values comes up in that
> field and which options affect the value that is returned.
>
> Can someone help me?
>