No exception is fired for violations of primary key or fk?
Posted: 15.06.2010, 01:32
I'm trying to make an application to replicate data and I find the problem that no exceptions are triggered by violation of primary key or foreign key, is this something configurable or is it a mistake? The application is made in lazarus, with the latest svn version of the components, the driver is firebird-2.1, the databases are both firebird 2.1.
I've tried for example:
q: = TZquery.create (nil);
try
q.Connection: = Aconnection;
q.SQL.Text: = 'insert into table values (' key1 ',' val2 ')';
q.ExecSql;
q.Close;
except
on e: Exception do
begin
.....
end;
end;
and also
Aconnection.ExecuteDirect ('insert into table values (' key1 ',' val2')');
Although the row already exists I do not produce any exception.
I would appreciate an answer.
Sorry for my bad English.
I've tried for example:
q: = TZquery.create (nil);
try
q.Connection: = Aconnection;
q.SQL.Text: = 'insert into table values (' key1 ',' val2 ')';
q.ExecSql;
q.Close;
except
on e: Exception do
begin
.....
end;
end;
and also
Aconnection.ExecuteDirect ('insert into table values (' key1 ',' val2')');
Although the row already exists I do not produce any exception.
I would appreciate an answer.
Sorry for my bad English.