GeneXus - AUTOENUMERAR UNA CLAVE PRIMARIA

 
Vista:

AUTOENUMERAR UNA CLAVE PRIMARIA

Publicado por MACARENA (3 intervenciones) el 08/10/2003 05:45:18
ALGUIEN ME PODRIA DECIR COMO ENUMERAR UNA CLAVE PRIMARIA CUALQUIERA, ME HAN DICHO COMO EN EL FORO PERO ESTAN MALOS LOS PROCEDIMIENTOS, ALGUIEN QUE REALMENTE SEPA, PORFA ME LO DIGA, Y SEAN DETALLADOS, ASI SERIA MEJOR.
SE LOS AGRADECERE DESDE EL FONDO EN SERIO,
CUALQUIER COSA QUE PUEDA HACER POR USTEDES DIGANME QUE YO LO HAGO, MIENTRAS SU RESPUESTA ESTE CORRECTA CLARO, POR QUE NI9NGUNA RESPUESTA ESTA CORRECTA, TRABAJO CON GX 7.5 Y LAS APLICACIONES LAS HAGO EN WEBFORM, SALIDA PARA INTERNET.
BESOS..................
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:AUTOENUMERAR UNA CLAVE PRIMARIA

Publicado por Federico (7 intervenciones) el 08/10/2003 22:24:55
En la 7.5 no tenes autonumerico, lo podes simular con
la regla Serial
Ej
CLAVEFIJ* C(1)
ULTIMO N(5)
(Clave* N(5)
otrocampo)

a regla seria

CLAVEFIJ = 'F';
Serial(Clave ,ULTIMO ,1 );

O recibiendo como parametro el ultimo Nro e Incrementar con las reglas
Clave = &proximo if insert;
&proximo = &Proxmo + 1 if insert .And. after(Clave);
noaccept(clave);

En la 8.0 ya existe el tipo Autoimcrementable
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar