Board index » delphi » Paradox: Updatable on ORDER BY [StringField] ???

Paradox: Updatable on ORDER BY [StringField] ???

Paradox, TQuery:

RequestLive works fine if I create an index and order the SQL statement by a
number field, but not on a String-field. It won't become updatable even if I
combine a number field and a stringfield in the index.

Example:

1.: CREATE INDEX CustomerIndex ON "CUSTOMER.DB" (CustNo) ---> CanModify =
True
2.: CREATE INDEX CustomerIndex ON "CUSTOMER.DB" (CustName) ---> CanModify =
False
3.: CREATE INDEX CustomerIndex ON "CUSTOMER.DB" (CustNo,CustName) --->
CanModify = False

Any solution?
How can I sort on CustName and still get an editable dataset?

Yours
Jedi

 

Re:Paradox: Updatable on ORDER BY [StringField] ???


Quote
>Jedi-frog wrote:

>RequestLive works fine if I create an index and order the SQL statement >by a number field, but not on a String-field. It won't become updatable

See 'updatable queries' in LocalSQL.hlp regarding conditions for
editable query results.

If the SQL statement contains an ORDER BY clause, you will get a live
result set only if ORDER BY uses the fields of the *primary* index.
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp5
Direct replies mailto:p...@augsburg.netsurf.de

Re:Paradox: Updatable on ORDER BY [StringField] ???


Quote
> >RequestLive works fine if I create an index and order the SQL statement
>by a number field, but not on a String-field. It won't become updatable

> See 'updatable queries' in LocalSQL.hlp regarding conditions for
> editable query results.

> If the SQL statement contains an ORDER BY clause, you will get a live
> result set only if ORDER BY uses the fields of the *primary* index.
> ________
> Andreas
> Delphi 5.01 Pro, NT4.0 Sp5
> Direct replies mailto:p...@augsburg.netsurf.de

Dear Andreas
Your conclution is only partial true. RequestLive actually offers a wider
aspect of options. I modify queries which is sorted on any single or
multicoumn secondary index as long as the fields are numbers. I have
searched the entire LocalSQL guide including the one you are refering to,
but no Delphi Help gives me the answer I'm looking for.

Meaning I'm still stuck with that problem, but I appreciate your attempt
very much.

Yours
Jedi

Re:Paradox: Updatable on ORDER BY [StringField] ???


The short answer is that you cannot do that. The on-line help lists the
conditions under which RequestLive is supported. It may work with integer
fields but it is not supposed to and does not with strings. The only
solutions I know of are to change to another database, for example
Interbase, that does allow what you want or to use ClientDataSets and
perform the sort on the client side.

--
Bill

Re:Paradox: Updatable on ORDER BY [StringField] ???


Quote
"Jedi-frog" wrote:
>Your conclution is only partial true. RequestLive actually offers a wider
>aspect of options. I modify queries which is sorted on any single or
>multicoumn secondary index as long as the fields are numbers. I have
>searched the entire LocalSQL guide including the one you are refering to,
>but no Delphi Help gives me the answer I'm looking for.

>Meaning I'm still stuck with that problem, but I appreciate your attempt
>very much.

IIRC you must declare the secondary indexes (that shall support
the ORDER BY) as "case sensitive" to get editable queries.
I don't know how to do this with a CREATE INDEX statement,
but it works if you use Database Desktop to create the index.

Other Threads