Traverse All Records in a Table with Inactive Index

Posted by Jeff Ledbetter on 01-Jul-2015 15:00

Hi.

I have a table with an inactive primary index. I need to read all records to set some default values but the OPEN QUERY statement wants to choose the primary index and then complains that it is inactive. Is there an option to tell the OPEN QUERY statement to not use any index and just plow through every record?

Thanks.

Posted by Jeff Ledbetter on 01-Jul-2015 15:18

 
Yeah, it looks like I am going to have to revert to that option. I was hoping to not have to but it does get the job done.
 
Jeff Ledbetter
www.roundtable-software.com
email: jeff.ledbetter@roundtable-software.com
skype: jeff.ledbetter
 
[collapse]
From: Thomas Mercer-Hursh [mailto:bounce-tamhas@community.progress.com]
Sent: Wednesday, July 1, 2015 3:13 PM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Traverse All Records in a Table with Inactive Index
 
Reply by Thomas Mercer-Hursh

Is there another index that is active?   USE-INDEX?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

All Replies

Posted by Mike Fechner on 01-Jul-2015 15:04

Isn’t that what the TABLE-SCAN option was made for?

Posted by Jeff Ledbetter on 01-Jul-2015 15:06

Only when it’s a FOR EACH, Type II storage area, and not an OPEN QUERY statement.
 
 
Jeff Ledbetter
skype: jeff.ledbetter
 
[collapse]
From: Mike Fechner [mailto:bounce-mikefechner@community.progress.com]
Sent: Wednesday, July 1, 2015 3:05 PM
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] AW: Traverse All Records in a Table with Inactive Index
 
Reply by Mike Fechner

Isn’t that what the TABLE-SCAN option was made for?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Mike Fechner on 01-Jul-2015 15:08

Bummer.

Posted by Thomas Mercer-Hursh on 01-Jul-2015 15:12

Is there another index that is active?   USE-INDEX?

Posted by Fernando Souza on 01-Jul-2015 15:14

No, there isn't one for OPEN QUERY. Only FOR EACH's allow TABLE-SCAN, as you mentioned.

Posted by Jeff Ledbetter on 01-Jul-2015 15:18

 
Yeah, it looks like I am going to have to revert to that option. I was hoping to not have to but it does get the job done.
 
Jeff Ledbetter
skype: jeff.ledbetter
 
[collapse]
From: Thomas Mercer-Hursh [mailto:bounce-tamhas@community.progress.com]
Sent: Wednesday, July 1, 2015 3:13 PM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Traverse All Records in a Table with Inactive Index
 
Reply by Thomas Mercer-Hursh

Is there another index that is active?   USE-INDEX?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by George Potemkin on 01-Jul-2015 15:36

You can start session with the -noinactiveidx parameter to prevent the compiler selecting inactive indexes.

Posted by Thomas Mercer-Hursh on 01-Jul-2015 15:42

Or, you can write a FOR EACH instead of an OPEN QUERY and use TABLE-SCAN ... :)

Posted by TheMadDBA on 01-Jul-2015 15:49

Still doesn't help him if his table is in a Type 1 area.

Why Progress doesn't allow this on OPEN QUERY I have no idea. It would even be useful in some cases on Type 1 areas but at least I can understand why they didn't implement that.

Posted by Jeff Ledbetter on 01-Jul-2015 15:50

 
Thanks for the tip. Did not know about that one. I will give that a try.
 
Jeff Ledbetter
skype: jeff.ledbetter
 
[collapse]
From: George Potemkin [mailto:bounce-GeorgeP12@community.progress.com]
Sent: Wednesday, July 1, 2015 3:37 PM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Traverse All Records in a Table with Inactive Index
 
Reply by George Potemkin

You can start session with the -noinactiveidx to prevent the compiler selecting inactive indexes.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by gus on 01-Jul-2015 16:27

table-scan does not work on type 1 areas. for them, it uses the primary index or the default index.

for each ought to work with open query. don’t know why it doesn’t.

table-scan should work whereever you can say use-index.

regards, knower of even more obscure things.
gus

“In God we trust. All others bring data.” — W. Edwards Deming





> On Jul 1, 2015, at 4:50 PM, TheMadDBA wrote:
>
>[collapse] From: TheMadDBA
> Post: RE: Traverse All Records in a Table with Inactive Index
> Posted in: Forum
> Link: https://community.progress.com/community_groups/openedge_development/f/19/p/18914/67183.aspx#67183
>
> Still doesn't help him if his table is in a Type 1 area.
> Why Progress doesn't allow this on OPEN QUERY I have no idea. It would even be useful in some cases on Type 1 areas but at least I can understand why they didn't implement that.
>
>
> --
> You were sent this email because you opted to receive email notifications when someone created a new thread.
>
> To unsubscribe[collapse] from:
> - ...only this thread, disable notifications at https://community.progress.com/community_groups/openedge_development/f/19/p/18914/67183.aspx#67183.
> - ...all email notifications from Progress Community, navigate to "Settings", click on the "Email" tab, then under the "Email Configuration" section, set Send Notifications to "No".
>[/collapse][/collapse]

Posted by TheMadDBA on 01-Jul-2015 16:36

Does that include CAN-FIND and FIND? ;-)

Just kidding... please don't add that to the 4GL.

Posted by gus on 01-Jul-2015 16:39

On Jul 1, 2015, at 5:37 PM, TheMadDBA wrote:
>
> Does that include CAN-FIND and FIND? ;-)

but of course!

regards, knower of even more obscure things.
gus

“In God we trust. All others bring data.” — W. Edwards Deming

This thread is closed