Виталий писал(а):
Вопрос:
Как правильно получать записи из таблицы?
Внимательно прочитать документацию.
Sql Subsystem Dev-Man писал(а):
Design rules
This section gives some rules which should be followed when designing a database application. The reason for each rule is given after the rule.
Interactors or at least their types must be exported if they should be used as place holders in SQL statements.
(Non-exported types are not accessible through metaprogramming, and thus controls and the SQL string translation mechanism could not be used with them.)
Обратите внимание, что Read не гарантирует результат 100%, как предполагается в Вашем коде.
SqlDB писал(а):
PROCEDURE (t: Table) Read (row: INTEGER; VAR data: ANYREC)
NEW, ABSTRACT
Reads the row'th row of the result table into the interactor data.
...
Post
t.res IN {0, converted, truncated, overflow, incompatible, noData}
P.S. Док-я по Sql переведена.