Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sr_setfilter() and conditionals idexes

238 views
Skip to first unread message

Roberto Romeo

unread,
Mar 10, 2014, 7:48:22 PM3/10/14
to
Hello all.

Does anyone knows if sr_setfilter() could raise problems when browsing tables with a conditional index (index with a for clausole)?
I have problems with dbsetfilter() because I'm filtering a table for an empty field (disabled<>'Y') but the field disabled when is empty is null and dbsetfilter fails (no records are listed)
I trying to use sr_filter() following th sqlrdd manuals.
But when I set sr_setfilter("disabled<>'Y'") the conditional index fails (i.e.all rows are listed).
Any idea?
By the way Sr_setfilter() is suggested in the methodology manual, but is not listed in the refe4ence manual.

Best regards,

Roberto

cul...@gmail.com

unread,
Mar 10, 2014, 11:50:50 PM3/10/14
to
Roberto.

what kind of conditional index

Regards
Luiz
Message has been deleted

Roberto Romeo

unread,
Mar 12, 2014, 11:54:25 AM3/12/14
to
Luiz,

the original table was DBFCDX converted by DBF2SQL

fields used in index are

SO_ALIAS CHAR 13
SO_LIVELLO CHAR 1
SO_TIPSOT CHAR 1

index key [SO_ALIAS]
index for [SO_LIVELLO == "S" .AND. SO_TIPSOT == "C"]

In [SR_MGMNTINDEXES] this is the row for this index
TABLE_ TEMP
SIGNATURE_ 20140312 16:34:38 A
IDXNAME_ TEMP
PHIS_NAME_ TEMP_CLI1
IDXKEY_ "SO_ALIAS","SR_RECNO"
IDXFOR_ #011SO_LIVELLO == "S" .AND. SO_TIPSOT == "C"
IDXCOL_ NULL
TAG_ CLI1
TAGNUM_ 000014

Regards,

Roberto

cul...@gmail.com

unread,
Mar 12, 2014, 12:06:45 PM3/12/14
to
Roberto

Náo e pra dar problema, pois sr_setfilter e usado na clausula where da querie. e o for na navegacao

[]s
Luiz

Roberto Romeo

unread,
Mar 13, 2014, 8:18:58 AM3/13/14
to
Luiz,

sorry but I don't understand portuguese language and google translator does not help me. Are you told me that should not be a problem?

I used Sql profiler to see the queries.

The query creae by RDDSQL for browsing the table with the conditional index is this:

SELECT TOP 12 A.[SO_ALIAS], A.[SR_RECNO], A.[SR_DELETED] FROM [SOTT] A WHERE (INDFOR_001 = 'T') ORDER BY A.[SO_ALIAS], A.[SR_RECNO]

If I use SR_setfilter() to set a filter (in my case [coalesce(so_sospeso,'')<>'S']) the where clause used for the conditional index is substituted by the filter and the query becames:

SELECT TOP 12 A.[SO_ALIAS], A.[SR_RECNO], A.[SR_DELETED] FROM [SOTT] A WHERE ( coalesce(so_sospeso,'')<>'S') ORDER BY A.[SO_ALIAS], A.[SR_RECNO]

If this is the correct behavior of the SQLRDD the consequence is that I can't use SR_setfilter() if I need to use a conditional index (or I can use it only if I am able to add to the filter the condition used by the active index).

Regards,

Roberto

cul...@gmail.com

unread,
Mar 19, 2014, 12:34:17 AM3/19/14
to
Hi

which xharbour version and which sqlrdd version( .lib date) by default for clause is always added to where clause even with sr_setfilter, unless you library is to old

Regards
Luiz

Roberto Romeo

unread,
Mar 19, 2014, 1:59:58 PM3/19/14
to
Hi Luiz,

xharbour Builder Enterprise Edition November 2013 Build 1116 SQL.LIB (Is this the RDDSQL.LIB?) date is 2013-08-22.

Thanks!

Rob

Roberto Romeo

unread,
Dec 10, 2014, 3:57:59 PM12/10/14
to
Any news about this topic?

Regards,

Roberto
0 new messages