You are not logged in.
Pages: 1
how about update?
thank you.
I'll try
thank you,
on server, set:
Props.UseCache := False;
OK
function ExecuteSQL(FormatSQLWhere: string; const BoundsSQLWhere: array of const): Boolean;
var
Query: IRemoteSQL;
aSQL: RawUTF8;
begin
aSQL := FormatUTF8(PUTF8Char(FormatSQLWhere), [], BoundsSQLWhere);
if Client.Services['RemoteSQL'].Get(Query) then
try
Query.Execute(aSQL, False, False);
Result := True;
except
Result := False;
end;
end;
Iused delphi 2007 zeosdbo 7.2 mysql 5.6 windows 7
mOrmot is very grate product and I like it very much!
thease days, my server report "Out of memory" error.
my client code:
procedure TForm1.btnTestClick(Sender: TObject);
var
Data, SQL: string;
Data_ID: Integer;
begin
Data_ID := 1;
while not chkStop.Checked do
begin
Application.ProcessMessages;
Caption := IntToStr(Data_ID);
Data := widestringToUtf8('11123錦');
SQL := Format('update t_data set Dat=:(''%s''):,PostTime1=now(),s1=2 where Data_ID=%d', [Data, Data_ID]);
if not ExecuteSQL(sql, []) then
begin
ShowMessage('Fail to save data!');
Break;
end;
Inc(Data_ID);
end;
end;
when runing, I found the memory usesed by mormotServer increasing。
ok,
ExecuteSQL(
'insert into `t_appstaffonline`(Staff_ID, IP, AppName, OnLine, LastLoginTime)' +
'values(?,?,?,?,now())',[1, '127.0.0.1', 'app.exe', 1]);
this work fine.
thank you.
How can I fill the value of the field LastLoginTime with mysql server time "now()" when insert record to the table?
I use Delphi 2007 , Mysql 5.6,
CREATE TABLE `t_appstaffonline` (
`App_ID` INT(11) NOT NULL AUTO_INCREMENT ,
`Staff_ID` INT(11) NULL DEFAULT NULL,
`AppName` VARCHAR(50) NULL,
`IP` VARCHAR(50) NULL DEFAULT NULL,
`Online` INT(11) NULL DEFAULT 0,
`UpdateTime` TIMESTAMP NULL',
`LastLoginTime` TIMESTAMP NULL,
`LastLogOutTime` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`App_ID`),
UNIQUE INDEX `Idx_SAP` (`Staff_ID`, `AppName`)
);
I want to set LastLoginTime to DBServer's time,
so my SQL Statement:
'insert into `t_appstaffonline`(Staff_ID, IP, AppName, OnLine, LastLoginTime)' +
'values(?,?,?,?,?)',[1, '127.0.0.1', 'app.exe', 1, 'now()']);
but this does not work, and
'insert into `t_appstaffonline`(Staff_ID, IP, AppName, OnLine)' +
'values(?,?,?,?)',[1, '127.0.0.1', 'app.exe', 1]);
work fine, why
thank you.
thank you.
I did not get it work.
TSQLHttpClient to execute server functions, when return json datarows, how convert result to clientdataset?
hello,
My program need TSQLHttpClient to execute server functions, and I
use TSQLDBSocketConnectionProperties to open query,
could TSQLHttpClient and TSQLDBSocketConnectionProperties
use the same port?
Model := TSQLModel.Create([], ROOT_NAME);
ClientA := TSQLHttpClient.Create('127.0.0.1', '8192', Model);
Client.ServerTimeStampSynchronize;
with
fClientB := TSQLDBSocketConnectionProperties.Create('127.0.0.1:8192', 'myserver', 'myusername', 'password');
thank you. I use Delphi 2007 & xe2
hello,
My Code (I use zeosdbo ):
procedure TFrmMain.btnClick(Sender: TObject);
var
val: string;
begin
{ --- this do not work,
fClient.ExecuteNoResult(formatutf8('update `t_data` set `imgname`=''%''',
[AnsiToUtf8('錦錦.jpg')]), []);
}
// this work fine
val := '錦錦.jpg';
fClient.ExecuteNoResult('update `t_data` set `imgname`=?', [AnsiToUtf8(val)]);
{ ----- this will no work ----
sql := 'update `tb_status` set `imgname`=' + AnsiToUtf8('錦錦.jpg');
fClient.ExecuteNoResult(sql, []);
}
end;
Pages: 1