Subject | cannot insert new row setup |
---|---|
Author | newgen_315 |
Post date | 2005-07-01T15:01:19Z |
Hi all,
Sorry helen I think I sent this to the wrong address, but here it is
again if someone wants more information let me know
I checked the insertsql,keylinks but that does not seem to be the
problem.
I do not know which query the error is coming from. I do the same for
all my queries(maybe it's wrong) there is 23 of them, sorry for the
english
let me try and explain a typical setup for each query.
this routine should open all my queries.
begin
for i := 0 to ComponentCount-1 do
begin
if Components[i] is TIBOQuery then
begin
with Components[i] as TIBOQuery do
begin
Active := False;
IB_Connection := TireServer;
PessimisticLocking := False;
// BufferSynchroFlags := [bsAfterEdit];
RequestLive := True;
ReadOnly := false;
FetchWholeRows := True;
CachedUpdates := False;
AutoFetchAll := True; // False;
KeyLinksAutoDefine := False;
// MaxRows := 0;
ParamCheck := True; //ver much required for
Mast/Detail
if sql.text <> '' then
active := true;
end;
end;
end;
end;
//
/* manufacturer names */
CREATE TABLE MANUFACT (
IDMAN INTEGER NOT NULL
, MANCODE VARCHAR( 8 )
, MANNAME VARCHAR( 35 )
, PRIMARY KEY ( IDMAN )
);
commit;
SET TERM ^;
create procedure DeleteManufact(
IDMAN INTEGER
)
as
begin
delete from MANUFACT
where IDMAN = :IDMAN;
end^
SET TERM ;^
SET TERM ^;
create procedure NewManufact(
IDMAN INTEGER
, MANCODE VARCHAR( 8 )
, MANNAME VARCHAR( 35 )
)
as
begin
insert into MANUFACT
(IDMAN,MANCODE,MANNAME )
values
(:IDMAN,:MANCODE, :MANNAME );
suspend;
end^
SET TERM ;^
SET TERM ^;
create procedure ModifyManufact(
IDMAN INTEGER
, MANCODE VARCHAR( 8 )
, MANNAME VARCHAR( 35 )
)
as
begin
update MANUFACT set
MANCODE = :MANCODE, MANNAME = :MANNAME
where IDMAN = :IDMAN;
end^
SET TERM ;^
/* Generators to AutoInc fields for table "MANUFACT" */
CREATE GENERATOR GEN_MANUFACT_IDMAN;
SET GENERATOR GEN_MANUFACT_IDMAN TO 200;
SET TERM ^;
CREATE TRIGGER TRIG_MANUFACT_BI FOR MANUFACT BEFORE INSERT
AS BEGIN
IF(NEW.IDMAN IS NULL) THEN NEW.IDMAN = GEN_ID
(GEN_MANUFACT_IDMAN,1);
END ^
SET TERM ;^
IBOQuery sql
select * from manufact
order by MANNAME
IBOQuery insertsql
execute procedure newMANUFACT
(:IDMAN,:MANCODE, :MANNAME )
IBOQuery editsql
execute procedure ModifyMANUFACT
(:IDMAN, :MANCODE, :MANNAME)
IBOquery keylinks
IDMAN
iboquey generatorlinks
IDMAN=GEN_MANUFACT_IDMAN
This is what I do for all my queries, how can I debug this and find
out which table is giving me the error' cannot insert new row'?
Hope this is enough information
Daniel
Sorry helen I think I sent this to the wrong address, but here it is
again if someone wants more information let me know
I checked the insertsql,keylinks but that does not seem to be the
problem.
I do not know which query the error is coming from. I do the same for
all my queries(maybe it's wrong) there is 23 of them, sorry for the
english
let me try and explain a typical setup for each query.
this routine should open all my queries.
begin
for i := 0 to ComponentCount-1 do
begin
if Components[i] is TIBOQuery then
begin
with Components[i] as TIBOQuery do
begin
Active := False;
IB_Connection := TireServer;
PessimisticLocking := False;
// BufferSynchroFlags := [bsAfterEdit];
RequestLive := True;
ReadOnly := false;
FetchWholeRows := True;
CachedUpdates := False;
AutoFetchAll := True; // False;
KeyLinksAutoDefine := False;
// MaxRows := 0;
ParamCheck := True; //ver much required for
Mast/Detail
if sql.text <> '' then
active := true;
end;
end;
end;
end;
//
/* manufacturer names */
CREATE TABLE MANUFACT (
IDMAN INTEGER NOT NULL
, MANCODE VARCHAR( 8 )
, MANNAME VARCHAR( 35 )
, PRIMARY KEY ( IDMAN )
);
commit;
SET TERM ^;
create procedure DeleteManufact(
IDMAN INTEGER
)
as
begin
delete from MANUFACT
where IDMAN = :IDMAN;
end^
SET TERM ;^
SET TERM ^;
create procedure NewManufact(
IDMAN INTEGER
, MANCODE VARCHAR( 8 )
, MANNAME VARCHAR( 35 )
)
as
begin
insert into MANUFACT
(IDMAN,MANCODE,MANNAME )
values
(:IDMAN,:MANCODE, :MANNAME );
suspend;
end^
SET TERM ;^
SET TERM ^;
create procedure ModifyManufact(
IDMAN INTEGER
, MANCODE VARCHAR( 8 )
, MANNAME VARCHAR( 35 )
)
as
begin
update MANUFACT set
MANCODE = :MANCODE, MANNAME = :MANNAME
where IDMAN = :IDMAN;
end^
SET TERM ;^
/* Generators to AutoInc fields for table "MANUFACT" */
CREATE GENERATOR GEN_MANUFACT_IDMAN;
SET GENERATOR GEN_MANUFACT_IDMAN TO 200;
SET TERM ^;
CREATE TRIGGER TRIG_MANUFACT_BI FOR MANUFACT BEFORE INSERT
AS BEGIN
IF(NEW.IDMAN IS NULL) THEN NEW.IDMAN = GEN_ID
(GEN_MANUFACT_IDMAN,1);
END ^
SET TERM ;^
IBOQuery sql
select * from manufact
order by MANNAME
IBOQuery insertsql
execute procedure newMANUFACT
(:IDMAN,:MANCODE, :MANNAME )
IBOQuery editsql
execute procedure ModifyMANUFACT
(:IDMAN, :MANCODE, :MANNAME)
IBOquery keylinks
IDMAN
iboquey generatorlinks
IDMAN=GEN_MANUFACT_IDMAN
This is what I do for all my queries, how can I debug this and find
out which table is giving me the error' cannot insert new row'?
Hope this is enough information
Daniel