It does not work delete from
Posted: 21.11.2011, 13:26
hello
I'm using the latest version from SVN zeoslib
I want to delete all data from a table uin_test
when the query: delete from uin_test where 1;
from the table uin_test nothing is removed
what could be wrong?
I create a table like this:
insert data and execute procedures SQL_Zeos_Exec('delete from uin_test where 1;');
MainForm.pas:
MainForm.dfm:
I'm using the latest version from SVN zeoslib
I want to delete all data from a table uin_test
when the query: delete from uin_test where 1;
from the table uin_test nothing is removed
what could be wrong?
I create a table like this:
Code: Select all
CREATE TABLE uin_test (
id integer primary key autoincrement not null unique,
proto_name int(2) default 0 not null,
my_nick varchar(128) default null,
my_uin varchar(128) default null,
nick varchar(128) default null,
uin varchar(128) default null,
msg_direction int(1) default 0 not null,
msg_time timestamp(14) not null,
msg_text text
);
MainForm.pas:
Code: Select all
procedure TMainForm.DeleteAllHistoryClick(Sender: TObject);
begin
SQL_Zeos_Exec('delete from uin_test where 1;');
end;
procedure TMainForm.SQL_Zeos_Exec(Sql: WideString);
begin
if ZConnection1.Connected then
begin
ViewerQuery.Close;
ViewerQuery.SQL.Clear;
ViewerQuery.SQL.Text := Sql;
ViewerQuery.ExecSQL;
end;
end;
Code: Select all
object ZConnection1: TZConnection
TransactIsolationLevel = tiReadCommitted
Left = 216
Top = 200
end
object ViewerQuery: TZQuery
Connection = ZConnection1
Params = <>
Left = 288
Top = 200
end