Error en índices temporales

Post Reply
User avatar
acuellar
Posts: 1645
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Error en índices temporales

Post by acuellar »

Buenas estimados

Tenía funcionando perfectamente los índices temporales
Y ahora no funciona el primero

Code: Select all | Expand

     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

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: 1645
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Error en índices temporales

Post by acuellar »

Encontré el error

Hice memoria de los últimos cambios, y había agregado ésto:

Code: Select all | Expand

 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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Error en índices temporales

Post by nageswaragunupudi »

Code: Select all | Expand

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

Code: Select all | Expand

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

Re: Error en índices temporales

Post by acuellar »

Thank you very much Mr. Rao
Saludos,

Adhemar C.
wartiaga
Posts: 215
Joined: Wed May 25, 2016 1:04 am

Re: Error en índices temporales

Post by wartiaga »

nageswaragunupudi wrote:

Code: Select all | Expand

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

Code: Select all | Expand

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.
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Error en índices temporales

Post by nageswaragunupudi »

Code: Select all | Expand

METHOD CreateIndex( cFile, cTag, cKey, lUnique, lDescend, lMemory )
You can also execute any command like this:

Code: Select all | Expand

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

G. N. Rao.
Hyderabad, India
wartiaga
Posts: 215
Joined: Wed May 25, 2016 1:04 am

Re: Error en índices temporales

Post by wartiaga »

nageswaragunupudi wrote:

Code: Select all | Expand

METHOD CreateIndex( cFile, cTag, cKey, lUnique, lDescend, lMemory )
You can also execute any command like this:

Code: Select all | Expand

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?
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Error en índices temporales

Post by nageswaragunupudi »

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

Re: Error en índices temporales

Post by wartiaga »

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!
Post Reply