Ver Mensaje Individual
  #7  
Antiguo 23-11-2007
Avatar de alexander_lv
alexander_lv alexander_lv is offline
Miembro
 
Registrado: mar 2007
Ubicación: Colombia - Quindio - Circasia
Posts: 11
Reputación: 0
alexander_lv Va por buen camino
hay una funcion RecordCountInQuery

el FIBPlus ya tiene una funcion para que hace exactamente el

Código SQL [-]
SELECT COUNT(*) FROM Table1

Código Delphi [-]
function RecordCountInQuery(FQuery: TFIBQuery): integer;

muy funcional para que no hagas otra sentencia porque se le llena el codigo de sentencias sql repetidas pero tiene unas limitaciones







Unit

CommonIB

function RecordCountInQuery(FQuery: TFIBQuery): integer;

Description

Call RecordCountInQuery to get a number of records, which are returned by the query (FQuery). The procedure tries to change a query text in FQuery.SQL and executes changed query. For example, if you set FQuery.SQL to 'SELECT * FROM Table1' RecordCountInQuery executes the following query: SELECT COUNT(*) FROM Table1. It allows getting number of result records for a query without fetching records. However, this function has some limitations. You can not use this function for queries, which include GROUP BY, DISTINCT and UNION options.

Última edición por alexander_lv fecha: 23-11-2007 a las 20:32:42.
Responder Con Cita