FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Error en índices temporales
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Error en índices temporales
Posted: Fri Dec 16, 2022 10:30 PM
Buenas estimados

Tenía funcionando perfectamente los índices temporales
Y ahora no funciona el primero
Code (fw): Select all Collapse
     USE CLIENTES ALIAS NITS NEW SHARED
    INDEX ON NITCI     TAG NIT FOR !Deleted() MEMORY //TEMPORARY
    INDEX ON CLIENTE TAG CLI FOR !Deleted() MEMORY
Si quiero hacer una búsqueda por NITCI me sale el error que no existe el indice.
He colocado
Code (fw): Select all Collapse
SET ORDER TO TAG NIT 
*TAMBIEN
 NITS->(OrdSetFocus(1))
Y Nada :(

Quizás a alguien le ha ocurrido

Gracias por la ayuda.
Saludos,



Adhemar C.
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Error en índices temporales
Posted: Fri Dec 16, 2022 11:04 PM
Encontré el error

Hice memoria de los últimos cambios, y había agregado ésto:
Code (fw): Select all Collapse
 SET AUTOPEN OFF  //En realidad no se para que es, Vi en un post de error de desbloqueo de registro.
El cuál hace que tome el último índice temporal.
Saludos,



Adhemar C.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Error en índices temporales
Posted: Sat Dec 17, 2022 05:33 AM
Code (fw): Select all Collapse
INDEX ON FIRST+LAST TAG NAME TEMPORARY
INDEX ON CITY+STATE TAG LOCATION TEMPORARY ADDITIVE
Now,
Code (fw): Select all Collapse
SET ORDER TO TAG NAME
// or
OrdSetFocus( "NAME" )
Do not use numbers. Always use TAG names. This is always safe.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Error en índices temporales
Posted: Sat Dec 17, 2022 11:09 AM

Thank you very much Mr. Rao

Saludos,



Adhemar C.
Posts: 253
Joined: Wed May 25, 2016 01:04 AM
Re: Error en índices temporales
Posted: Sat Dec 17, 2022 12:03 PM
nageswaragunupudi wrote:
Code (fw): Select all Collapse
INDEX ON FIRST+LAST TAG NAME TEMPORARY
INDEX ON CITY+STATE TAG LOCATION TEMPORARY ADDITIVE
Now,
Code (fw): Select all Collapse
SET ORDER TO TAG NAME
// or
OrdSetFocus( "NAME" )
Do not use numbers. Always use TAG names. This is always safe.
Mr. Rao can I use temporary index with database fivewin object? If Yes, how?
Thanks.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Error en índices temporales
Posted: Sat Dec 17, 2022 04:03 PM
Code (fw): Select all Collapse
METHOD CreateIndex( cFile, cTag, cKey, lUnique, lDescend, lMemory )
You can also execute any command like this:
Code (fw): Select all Collapse
oDbf:Exec( <|Self|
                 INDEX ON CITY+STATE TAG LOCATION TEMPORARY ADDITIVE
                 return nil
                 > )
Regards



G. N. Rao.

Hyderabad, India
Posts: 253
Joined: Wed May 25, 2016 01:04 AM
Re: Error en índices temporales
Posted: Sat Dec 17, 2022 09:03 PM
nageswaragunupudi wrote:
Code (fw): Select all Collapse
METHOD CreateIndex( cFile, cTag, cKey, lUnique, lDescend, lMemory )
You can also execute any command like this:
Code (fw): Select all Collapse
oDbf:Exec( <|Self|
                 INDEX ON CITY+STATE TAG LOCATION TEMPORARY ADDITIVE
                 return nil
                 > )
Thanks Mr. Rao. One more doubt. If the file already contains a cdx index, does this command create a new temporary cdx or add the tag to the existing index?
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Error en índices temporales
Posted: Sun Dec 18, 2022 05:08 AM

Temporary indexes do not affect the main cdx file.

They are available for use in the work area (alias) where created and not available for other aliases of the same dbf.

They are created as temporary files and deleted when the alias is closed.

They are also called memory indexes.

In the command, we can use either TEMPORARY or MEMORY.

Regards



G. N. Rao.

Hyderabad, India
Posts: 253
Joined: Wed May 25, 2016 01:04 AM
Re: Error en índices temporales
Posted: Mon Dec 19, 2022 06:10 PM
nageswaragunupudi wrote:Temporary indexes do not affect the main cdx file.
They are available for use in the work area (alias) where created and not available for other aliases of the same dbf.
They are created as temporary files and deleted when the alias is closed.

They are also called memory indexes.

In the command, we can use either TEMPORARY or MEMORY.
I tested it here and it worked perfectly, very very fast. Thank you!

Continue the discussion