PDA

Ver la Versión Completa : Como Insertar Registro Nuevo ENTRE los demás Registros????


AGAG4
17-01-2006, 23:55:23
Estoy usando IBX 6.08
Tengo un Maestro Detalle, en el detalle tengo como llave primaria Serie+Folio+Indice

El problema que tengo es que cuando tengo varios registros y quiero insertar un registro entre ellos al guardar el Registro Nuevo me lo Inserta al Final usando INSERT.

En el ibDataset Detalle no uso ningún order by.
Ejemplo:
Serie Folio Indice
XX 00001 1
XX 00001 2
XX 00001 3
XX 00001 4

Si Inserto en el Medio el Quinto Registro

Serie Folio Indice
XX 00001 1
XX 00001 2
XX 00001 5
XX 00001 3
XX 00001 4

Al Guardar me Queda así:

Serie Folio Indice
XX 00001 1
XX 00001 2
XX 00001 3
XX 00001 4
XX 00001 5

La solución sería quitar la llave primaria pero Rompo la Integridad de la Tabla.

Había pensado también usar el campo indice de tipo Flotante Sumandole al registro nuevo 0.01 con respecto al Anterior.
Serie Folio Indice
XX 00001 1.0
XX 00001 2.0
XX 00001 2.1
XX 00001 3.0
XX 00001 4.0

Alguna sugerencia más????

Agradezco Mucho cualquier información.

roman
18-01-2006, 03:03:45
Nunca te bases en el orden físico de los registros. Si necesitas un cierto orden particular, añade un campo entero que lleve el orden.

// Saludos