Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Firebird e Interbase
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 25-11-2004
Avatar de LordBits
LordBits LordBits is offline
Miembro
 
Registrado: nov 2004
Posts: 15
Poder: 0
LordBits Va por buen camino
esta es la solucion que dan en www.ibphoenix.com..

Assume that you have already created a generator in your database as:

CREATE GENERATOR my_gen_id;

Examples:
Method 1: (SQL)
SELECT DISTINCT(GEN_ID(my_gen_id, 0))FROM table_name;
NOTE: Please notice that the increment value is (0) zero. This is to ensure
that you do not increment the generator when querying for its next value.

Method 2: (ISQL)
While attached to the database via an ISQL session type the following.
SQL> SHOW GENERATOR my_gen_id;

Method 3: (STORED PROCEDURE)
Code:
SET TERM !!;
CREATE PROCEDURE get_next_gen_value
RETURNS (next_value INTEGER)
AS
BEGIN
next_value = GEN_ID(my_gen_id, 0);
SUSPEND;
END !!
SET TERM ;!!

NOTE: Please notice that the increment value is (0) zero. This is to ensure
that you do not increment the generator when querying for its next value.
Once the procedure is successfully created you can issue a SELECT statement
against it.

SQL:
SELECT * FROM get_next_gen_value;
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 00:37:02.


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