You are not logged in.
Pages: 1
Sir, how to find Message based on time like this
Rec := TSQLSampleRecord.Create(Database,'Name="%"',[StringToUTF8(NameEdit.Text)]);
and in Sqlite3, can you write one Query Options based one time Colfield ,i haven't found any files about this.
like this,One is statand SQL option, another is delphi query option
select * from Samplerecord where time....
thanks a lot,
Last edited by longge007 (2010-07-23 09:56:04)
Offline
for executing a SQL statement
select * from Samplerecord where time....
you must use TSQLRestClient.List, defined as such:
TSQLRestClient = class(TSQLRest)
public
/// retrieve a list of members as a TSQLTable (implements REST GET Collection)
// - default SQL statement is 'SELECT ID FROM TableName;' (i.e. retrieve
// the list of all ID of this collection members)
// - optional SQLSelect parameter to change the returned fields
// as in 'SELECT SQLSelect FROM TableName;'
// - optional SQLWhere parameter to change the search range or ORDER
// as in 'SELECT SQLSelect FROM TableName WHERE SQLWhere;'
function List(const Tables: array of TClass; const SQLSelect: RawUTF8 = 'ID';
const SQLWhere: RawUTF8 = ''): TSQLTableJSON; virtual; abstract;
So you'll code for example:
var J: TSQLTableJSON;
i, FieldIndex: integer;
(...)
J := Client.List([TSQLSampleRecord],'*','Time='+Int32ToUtf8(TimeValue));
if J<>nil then
try
FieldIndex := J.FieldIndex('Name');
if FieldIndex>=0 then
for i := 1 to J.RowCount do
ListBox.Add(UTF8ToString(J.GetU(i,FieldIndex)));
finally
J.Free;
end;
Offline
if my Datetime is 2010-07-22 18:44:52:532,in fact it's double
the Int32ToUft8() only can get Int value,
how to transfer,thanks a lot
Offline
Pages: 1