Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/08/2005, 14:18
lotusxxl
 
Fecha de Ingreso: junio-2002
Mensajes: 243
Antigüedad: 21 años, 11 meses
Puntos: 1
No se si hay algún modo mejor de hacerlo pero cuando yo hice oracle lo hacia así...

CREATE SEQUENCE secuencia1
START WITH 1
INCREMENT BY 1
MINVALUE 1
NOCACHE
NOCYCLE
NOORDER;


create or replace trigger autoincrement_tabla1
before insert on tabla1
for each row
begin
select secuencia1.nextval into :new.id from dual;
end;

Donde new.id es el campo de la tabla q queires hacer autoincrement.

Espero q te sriva de algo.

Salu2.