You are not logged in.
Pages: 1
Hi AB.
I have created this class:
type
TCertidao = class(TSQLRecord)
private
FControle: RawUTF8;
FData: TDateTime;
FNumero: RawUTF8;
FServidor: TServidors;
published
property Numero: RawUTF8 index 12 read FNumero write FNumero;
property Controle: RawUTF8 index 8 read FControle write FControle;
property Data: TDateTime read FData write FData;
property Servidor: TServidors read FServidor write FServidor;
end;
I need the fields Numero as VARCHAR(12) and Controle as VARCHAR(8).
But when I look the sqlite file in SQLite Administrator, they are all TEXT. Field DATA is TEXT too.
How can I correct this?
I am using your current check-in http://synopse.info/fossil/vinfo?name=6 … 9a28ebc547
Last edited by Junior/RO (2013-02-01 16:49:20)
Offline
In the SQlite3 engine, there is no field width for TEXT columns.
See http://www.sqlite.org/faq.html#q9
In mORMot, TDateTime fields are stored as ISO-8601 text (as expected by SQlite3 itself for time/date functions, by the way).
See http://www.sqlite.org/lang_datefunc.html
If you need a pure Delphi value, just use a double column.
If you need some efficient timestamp, take a look at the TimeLog type for a column.
So the behavior on your table is perfectly as expected.
See the SAD pdf, in the "TSQLRecord fields" paragraph.
Offline
Pages: 1