Error en índices temporales

Error en índices temporales

Postby acuellar » Fri Dec 16, 2022 10:30 pm

Buenas estimados

Tenía funcionando perfectamente los índices temporales
Y ahora no funciona el primero
Code: Select all  Expand view

     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: Select all  Expand view

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.
User avatar
acuellar
 
Posts: 1593
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Error en índices temporales

Postby acuellar » Fri Dec 16, 2022 11:04 pm

Encontré el error

Hice memoria de los últimos cambios, y había agregado ésto:
Code: Select all  Expand view

 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.
User avatar
acuellar
 
Posts: 1593
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Error en índices temporales

Postby nageswaragunupudi » Sat Dec 17, 2022 5:33 am

Code: Select all  Expand view

INDEX ON FIRST+LAST TAG NAME TEMPORARY
INDEX ON CITY+STATE TAG LOCATION TEMPORARY ADDITIVE
 


Now,
Code: Select all  Expand view

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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Error en índices temporales

Postby acuellar » Sat Dec 17, 2022 11:09 am

Thank you very much Mr. Rao
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1593
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Error en índices temporales

Postby wartiaga » Sat Dec 17, 2022 12:03 pm

nageswaragunupudi wrote:
Code: Select all  Expand view

INDEX ON FIRST+LAST TAG NAME TEMPORARY
INDEX ON CITY+STATE TAG LOCATION TEMPORARY ADDITIVE
 


Now,
Code: Select all  Expand view

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.
wartiaga
 
Posts: 175
Joined: Wed May 25, 2016 1:04 am

Re: Error en índices temporales

Postby nageswaragunupudi » Sat Dec 17, 2022 4:03 pm

Code: Select all  Expand view
METHOD CreateIndex( cFile, cTag, cKey, lUnique, lDescend, lMemory )


You can also execute any command like this:
Code: Select all  Expand view

oDbf:Exec( <|Self|
                 INDEX ON CITY+STATE TAG LOCATION TEMPORARY ADDITIVE
                 return nil
                 > )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Error en índices temporales

Postby wartiaga » Sat Dec 17, 2022 9:03 pm

nageswaragunupudi wrote:
Code: Select all  Expand view
METHOD CreateIndex( cFile, cTag, cKey, lUnique, lDescend, lMemory )


You can also execute any command like this:
Code: Select all  Expand view

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?
wartiaga
 
Posts: 175
Joined: Wed May 25, 2016 1:04 am

Re: Error en índices temporales

Postby nageswaragunupudi » Sun Dec 18, 2022 5: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Error en índices temporales

Postby wartiaga » Mon Dec 19, 2022 6: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!
wartiaga
 
Posts: 175
Joined: Wed May 25, 2016 1:04 am


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 94 guests