Форум: "Базы";
Текущий архив: 2002.04.04;
Скачать: [xml.tar.bz2];
Внизсортировка записей в БД по данным полей - данные просто строки... дайте рабочую заготовку. Найти похожие ветки
← →
Turalyon (2002-03-12 08:45) [5]>stub ©
Вот пример из Help-а может ты неудачно посмотрел... К тому же, как верно заметил Анатолий, SQL запрос просто возвращает набор данных (я думал тебе именно это и надо), а функция которую он предложил именно физически сортирует таблицу. Дальше смотри сам что именно тебе необходимо.
Sort the source table into the destination table on the given field.
This example uses the following input:
fDbiSortTable(CustomerTbl, CustomerTbl2, CustomerTbl.FieldByName("COMPANY"));
The function is:
function fDbiSortTable(SrcTbl, DestTbl: TTable; SortField: TField): Longint;
var
Field: Word;
CaseIns: Boolean;
Recs: Longint;
begin
Recs := SrcTbl.RecordCount;
CaseIns := True;
Field := SortField.Index + 1;
if not DestTbl.Active then
raise EDatabaseError.Create("Cannot complete operation with " +
"destination table closed");
Check(DbiSortTable(SrcTbl.DBHandle, nil, nil, SrcTbl.Handle, nil, nil,
DestTbl.Handle, 1, @Field, @CaseIns, nil, nil, False, nil, Recs));
Result := Recs;
end;
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2002.04.04;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.004 c