Subject Re: [IBO] insertSQL Help please (again)
Author newgen3152003
Thanks for your help Helen,

This is the whole code section, and generatorlinks is set in the
dataset. it starts with a click of the dbnavigator button, I sure
would like to know the problem with this, I have also tried coding
the insertsql directly in the datset property, no difference.


procedure TLocatT.LocatInsert;
begin
with DataM.AllLoc do
begin
ReadOnly := False;
InsertSQL.Text := ' ';
InsertSQL.Append('execute procedure NewLocation');
InsertSQL.Append
('(:LOCCODE, :LOCNAME, :LOCTYPE , :ADD1, :ADD2, :CITY,');
InsertSQL.Append
(':PROV, :ZIP , :PHONE, :FAX , :AUX, :CONTACT, :EMAIL , :COMMENTS , :N
OTE );');
prepare;
open;
insert;

in the generatorlinks of the dataset
IDLOC=GEN_LOCATIONS_IDLOC

the stored procedure/ and trigger

SET TERM ^;
create procedure NewLocation(
LOCCODE VARCHAR( 8 )
, LOCNAME VARCHAR( 35 )
, LOCTYPE VARCHAR( 25 )
, ADD1 VARCHAR( 35 )
, ADD2 VARCHAR( 35 )
, CITY VARCHAR( 25 )
, PROV VARCHAR( 8 )
, ZIP VARCHAR( 10 )
, PHONE VARCHAR( 15 )
, FAX VARCHAR( 15 )
, AUX VARCHAR( 15 )
, CONTACT VARCHAR( 35 )
, EMAIL VARCHAR( 35 )
, COMMENTS VARCHAR( 50 )
, NOTE BLOB( 65535, 0 )
)
as
begin
insert into LOCATIONS
(LOCCODE,LOCNAME,LOCTYPE ,ADD1,ADD2,CITY,PROV, ZIP , PHONE, FAX ,
AUX, CONTACT, EMAIL , COMMENTS , NOTE )
values

(:LOCCODE, :LOCNAME, :LOCTYPE , :ADD1, :ADD2, :CITY, :PROV, :ZIP , :PH
ONE, :FAX , :AUX, :CONTACT, :EMAIL , :COMMENTS , :NOTE );

end^
SET TERM ;^

/* Generators to AutoInc fields for table "LOCATIONS" */
CREATE GENERATOR GEN_LOCATIONS_IDLOC;
SET GENERATOR GEN_LOCATIONS_IDLOC TO 200;

SET TERM ^;
CREATE TRIGGER TRIG_LOCATIONS_BI FOR LOCATIONS BEFORE INSERT
AS BEGIN
IF(NEW.IDLOC IS NULL) THEN NEW.IDLOC = GEN_ID
(GEN_LOCATIONS_IDLOC,1);
END ^
SET TERM ;^