Вниз
Скачать: CL | DM;

Работа с таблицами БД   Найти похожие ветки 

 
BOBAH   (2003-05-26 16:00) [0]

Как бы ограничить число записей, получаемых из таблицы при ее открытии в случае SQL-сервера и локальной таблицы?


 
Anatoly Podgoretsky ©   (2003-05-26 16:05) [1]

TOP n


 
passm ©   (2003-05-26 16:56) [2]

Это смотря какая СУБД.
Может быть и
SELECT...
FROM...
FETCH FIRST N ROWS ONLY


 
BOBAH   (2003-05-30 20:45) [3]

Просто хочется поделиться радостью. В справочной системе Delphi нашел-таки ответ, правда, работает это только с SQL-серверами:

Example 2: Specify the maximum number of rows to be fetched from an SQL statement.

Set the maximum rows fetched in the parameter MaxRows, for the SQL table specified in the Table parameter. This example uses the following input:

fDbiSetProp2(IBTable, 100);

The procedure is:

procedure fDbiSetProp2(Table: TTable; MaxRows: Longint);

var
rslt: DBIResult;
DBType: String;
Len: Word;
begin
SetLength(DBType, DBIMAXNAMELEN);
Check(DbiGetProp(hDBIObj(Table.DBHandle), dbDATABASETYPE,
PChar(DBType), DBIMAXNAMELEN, Len));
SetLength(DBType, StrLen(PChar(DBType)));
// Make sure the table type is not dBASE or Paradox (must be SQL based)
if (DBType = "STANDARD") then
raise EDBEngineError.Create(DBIERR_NOTSUPPORTED);
// Make sure that the property can be set

rslt := DbiValidateProp(hDBIObj(Table.Handle), curMAXROWS, True);
if (rslt = DBIERR_NONE) then
// Set the property
Check(DbiSetProp(hDBIObj(Table.Handle), curMAXROWS, MaxRows))
else
raise EDBEngineError.Create(rslt);
end;

Если кто-то все же знает, как сделать то же самое с таблицами локальных СУБД, сообщите, пожалуйста. Буду очень признателен.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.009 c
9-50195
Хранитель_7К
2003-01-10 10:55
2003.06.16
Вопрос по геометрии


1-50347
Rulya
2003-06-03 04:38
2003.06.16
Гнератор случайных чисел


3-50207
гончий
2003-05-26 11:12
2003.06.16
Как правильно удалить поле в таблице MSSQL?


4-50558
Шишкин Илья
2003-04-16 17:20
2003.06.16
функция GetWindow


14-50505
Soft
2003-05-30 16:02
2003.06.16
В чем разница между хакером и кракером?




   Наверх