Ver Mensaje Individual
  #1  
Antiguo 30-03-2010
Avatar de tgsistemas
tgsistemas tgsistemas is offline
Miembro
 
Registrado: dic 2003
Ubicación: Barcelona
Posts: 149
Reputación: 21
tgsistemas Va por buen camino
Params con Int64

Hola a tod@s,

no tengo claro si esta consulta corresponde a este foro o al de bbdd (mysql concretamente), así que si me he equivocado le pido disculpas a los moderadores

utilizo la siguiente función (no hay componentes visuales) con parámetros que devuelve un valor, el tema es que los datos en la tabla son del tipo bigint y el result también, pero no se cómo pasarle el párametro para ese tipo, utilizo Int64 :

Código Delphi [-]
function DimeCentroDiet(VDiet:Int64):Int64;
var
  MiQry : TZReadOnlyQuery;
  isql : string;
begin
  isql := 'select cntroasig from tb02D where cdgo = :cdgotemp';

  try
    MiQry := TZReadOnlyQuery.Create(nil);
    with MiQry do
    begin
      //Parent := FInsertar;
      MiQry.Connection := Data.ZConnectTGS;
      MiQry.SQL.Clear;
      MiQry.sql.Text := isql;
      MiQry.ParamByName('cdgotemp').asint64 := VDiet; //lo compila sin errores
      MiQry.Open;

      if MiQry.RecordCount >0 then begin
        Result := MiQry.fields[0].value;
      end else begin
        Result := 0;
      end;
    end;
  finally
    MiQry.Close;
    MiQry.Free;
  end;
end;
alguien podría indicarme qué estoy haciendo mal ??

Muchas Gracias a tod@s
__________________
Toni | blog
Responder Con Cita