Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Conexión con bases de datos (https://www.clubdelphi.com/foros/forumdisplay.php?f=2)
-   -   Como Insertar Registro Nuevo ENTRE los demás Registros???? (https://www.clubdelphi.com/foros/showthread.php?t=29282)

AGAG4 17-01-2006 23:55:23

Como Insertar Registro Nuevo ENTRE los demás Registros????
 
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


La franja horaria es GMT +2. Ahora son las 15:38:20.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi