Ver Mensaje Individual
  #6  
Antiguo 20-03-2008
cloayza cloayza is offline
Miembro
 
Registrado: may 2003
Ubicación: San Pedro de la Paz, Chile
Posts: 914
Reputación: 23
cloayza Tiene un aura espectacularcloayza Tiene un aura espectacular
Creo que esta es una posible solucion:

Crear procedimiento que devuelva los valores que necesito.

Código SQL [-]
CREATE PROCEDURE GET_INITIAL_VALUES
RETURNS(ID_DOMINIO AS INTEGER, 
             IP AS INTEGER,
            RACK AS INTEGER, 
            LP_SIP_ACTUAL AS INTEGER)
AS
BEGIN
       ID_DOMINIO=GEN_ID(CONTADOR_PARA_ID_DOMINIO_EN_CPU,1),
       IP             =GEN_ID(CONTADOR_PARA_IP_EN_CPU,1),
       RACK         =GEN_ID(CONTADOR_PARA_RACK_EN_CPU,1),
       LP_SIP_ACTUAL=GEN_ID(CONTADOR_PARA_IMP_EN_CPU,1);
    
      suspend;
END

Código Delphi [-]
procedure TDMCpu.IBCpuNewRecord(DataSet: TDataSet);
begin
     IBStoredProc1.StoreProcName:='GET_INITIAL_VALUES';
     IBStoredProc1.Prepare;
     IBStoredProc1.Open;
       IBCpu.FieldByName('ID_DOMINIO').AsInteger:=IBSQLValores_Iniciales.FieldByName('ID_DOMINIO').AsIntege  r;
IBCpu.FieldByName('IP').AsInteger:=IBSQLValores_Iniciales.FieldByName('IP').AsInteger;
IBCpu.FieldByName('RACK').AsInteger:=IBSQLValores_Iniciales.FieldByName('RACK').AsInteger;
IBCpu.FieldByName('LP_SIP_ACTUAL').AsInteger:=IBSQLValores_Iniciales.FieldByName('LP_SIP_ACTUAL').As  Integer;
     IBSQLValores_Iniciales.Close;
end;

Espero te sirva...
Saludos desde
Concepcion-Chile
Responder Con Cita