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.

Indices

4 posts in FoxPro Last posting was on 2009-11-17 22:24:27.0Z
Eric Selje Posted on 2009-11-17 20:29:16.0Z
From: "Eric Selje" <eselje@tcgcorp.net>
Newsgroups: Advantage.FoxPro
Subject: Indices
Date: Tue, 17 Nov 2009 14:29:16 -0600
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1983
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1983
NNTP-Posting-Host: 206.197.100.68
Message-ID: <4b03073a@solutions.advantagedatabase.com>
X-Trace: 17 Nov 2009 13:27:38 -0700, 206.197.100.68
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!206.197.100.68
Xref: solutions.advantagedatabase.com Advantage.FoxPro:318
Article PK: 1109672

I have a folder full of dbfs (free tables) that look like this:

12345.tim
m12345.cdx

(etc..)

I was able to tell ADD that the ".tim" files are the ones I want in the
database, but is there any way to also let it know that the 'm*.cdx' files
are the compound indices (not structural) that are associated with those
tables?

Thanks,

Eric


Lance Schmidt Posted on 2009-11-17 20:45:30.0Z
From: "Lance Schmidt" <LanceSc@ExtendSys.com>
Newsgroups: Advantage.FoxPro
References: <4b03073a@solutions.advantagedatabase.com>
Subject: Re: Indices
Date: Tue, 17 Nov 2009 13:45:30 -0700
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: 10.24.38.117
Message-ID: <4b030b08@solutions.advantagedatabase.com>
X-Trace: 17 Nov 2009 13:43:52 -0700, 10.24.38.117
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.117
Xref: solutions.advantagedatabase.com Advantage.FoxPro:319
Article PK: 1109671

Hi Eric,

You can use the following SQL statement to add non-structural indexes to a
table.

http://devzone.advantagedatabase.com/dz/WebHelp/Advantage9.1/advantage_sql/system_procedures/procedures/sp_addindexfiletodatabase.htm

If your index names are based off the file name then you could use the
following untested SQL script:

DECLARE Tables CURSOR as SELECT * FROM System.Tables;
DECLARE OutputCursor CURSOR;

TRY
DROP TABLE #Errors;
CATCH ALL
-- Ignore all ERRORS returned on this call.
END TRY;

CREATE TABLE #Errors( TableName Char( 200 ), ErrorCode integer, ErrorText
Memo );

OPEN Tables;

WHILE FETCH Tables DO
TRY
EXECUTE PROCEDURE sp_AddIndexFileToDatabase( Tables.Name,
'm' + Tables.Name +
'.cdx',
NULL );
CATCH ALL
INSERT INTO #Errors VALUES( Tables.Name, __ErrCode, __ErrText );
END TRY;
END WHILE;

OPEN OutputCursor AS SELECT Count(*) AS NumErrors FROM #Errors;
FETCH OutputCursor;
IF ( OutputCursor.NumErrors > 0 ) THEN
SELECT * FROM #Errors;
ELSE
SELECT 'Success' AS ReturnValue FROM System.Iota;
END IF;

Please try this on a copy of your database, since I haven't used it before.

Inside of Advantage Data Architect, you can add index files to a table by
right clicking on a table and selecting Add Existing Index File...

Best Regards,

Lance Schmidt
Advantage R&D

"Eric Selje" <eselje@tcgcorp.net> wrote in message
news:4b03073a@solutions.advantagedatabase.com...
>I have a folder full of dbfs (free tables) that look like this:
>
> 12345.tim
> m12345.cdx
>
> (etc..)
>
> I was able to tell ADD that the ".tim" files are the ones I want in the
> database, but is there any way to also let it know that the 'm*.cdx' files
> are the compound indices (not structural) that are associated with those
> tables?
>
> Thanks,
>
> Eric
>
>


Eric Selje Posted on 2009-11-17 21:23:07.0Z
From: "Eric Selje" <eselje@tcgcorp.net>
Newsgroups: Advantage.FoxPro
References: <4b03073a@solutions.advantagedatabase.com> <4b030b08@solutions.advantagedatabase.com>
Subject: Re: Indices
Date: Tue, 17 Nov 2009 15:23:07 -0600
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1983
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1983
NNTP-Posting-Host: 206.197.100.68
Message-ID: <4b0313db@solutions.advantagedatabase.com>
X-Trace: 17 Nov 2009 14:21:31 -0700, 206.197.100.68
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!206.197.100.68
Xref: solutions.advantagedatabase.com Advantage.FoxPro:320
Article PK: 1109674

Interesting, Lance, thanks. I'll give this a try, and if it works it keeps
the possiblities going. I'll also bone up on what other system procedures
are available to me.

Thanks,

Eric


Joachim Duerr (ADS) Posted on 2009-11-17 22:24:27.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: Indices
Newsgroups: Advantage.FoxPro
References: <4b03073a@solutions.advantagedatabase.com> <4b030b08@solutions.advantagedatabase.com> <4b0313db@solutions.advantagedatabase.com>
Date: Tue, 17 Nov 2009 23:24:27 +0100
User-Agent: XanaNews/1.19.1.194
X-Face: u2p+</,mb|Ah!x!/qxX5q0t:O~.<1&JzwNHYhSqcviY{~&|iDc"U.Je1A.ZeHR`d;;y#R
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 84.158.156.101
Message-ID: <4b032239@solutions.advantagedatabase.com>
X-Trace: 17 Nov 2009 15:22:49 -0700, 84.158.156.101
Lines: 13
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!84.158.156.101
Xref: solutions.advantagedatabase.com Advantage.FoxPro:324
Article PK: 1109678


Eric Selje wrote:

>I'll also bone up on what other system procedures
>are available to me.

for a complete list of built-in system procedures run following SQL:

select * from system.systemprocedures

--
Joachim Duerr
Advantage Presales
check out my new ADS book on http://www.jd-engineering.de/adsbuch