Hi,
I am using Interbase 7.1 and Delphi 7 -- stored procedures have JUST REFUSED to work for me...
! PS ASSIST...
i have created a simple stored procedure (INSERT_DISTRICT) to insert values into a table (districts) and calling the same from delphi code.
In delphi am also using a data module(dmodstocks) where i have dropeed all my components..
If i call the proceure directly from interbase, i cannot see the values inserted into the database, yet the query executes.
INTERBASE STORED PROC CODE:
SET TERM ^;
CREATE PROCEDURE insert_district
(
insDcode varchar(8),insDname varchar(20)
)
AS
BEGIN
INSERT INTO districts
(districtcode, districtname)
VALUES
(
:insDcode,
:insDname
);
END^
SET TERM ; ^
DELPHI CODE:
procedure TFrmDistrict.BtnSaveClick(Sender: TObject);
begin
Dmodstocks.IBSProcDists.Create(self);
with Dmodstocks.IBSProcDists do begin
Dmodstocks.IBSProcDists.Database := Dmodstocks.IBDBStocks;
StoredProcname := 'INSERT_DISTRICT';
Prepare;
Dmodstocks.IBSProcDists.ParamByName('InsDcode').AsString := DistCodetxt.Text;
Dmodstocks.IBSProcDists.Parambyname('InsDname').AsString := DistNametxt.Text;
ExecProc;
Free;
distcodetxt.Clear;
distNameTxt.Clear;
end;
end;
I am using Interbase 7.1 and Delphi 7 -- stored procedures have JUST REFUSED to work for me...
! PS ASSIST...
i have created a simple stored procedure (INSERT_DISTRICT) to insert values into a table (districts) and calling the same from delphi code.
In delphi am also using a data module(dmodstocks) where i have dropeed all my components..
If i call the proceure directly from interbase, i cannot see the values inserted into the database, yet the query executes.
INTERBASE STORED PROC CODE:
SET TERM ^;
CREATE PROCEDURE insert_district
(
insDcode varchar(8),insDname varchar(20)
)
AS
BEGIN
INSERT INTO districts
(districtcode, districtname)
VALUES
(
:insDcode,
:insDname
);
END^
SET TERM ; ^
DELPHI CODE:
procedure TFrmDistrict.BtnSaveClick(Sender: TObject);
begin
Dmodstocks.IBSProcDists.Create(self);
with Dmodstocks.IBSProcDists do begin
Dmodstocks.IBSProcDists.Database := Dmodstocks.IBDBStocks;
StoredProcname := 'INSERT_DISTRICT';
Prepare;
Dmodstocks.IBSProcDists.ParamByName('InsDcode').AsString := DistCodetxt.Text;
Dmodstocks.IBSProcDists.Parambyname('InsDname').AsString := DistNametxt.Text;
ExecProc;
Free;
distcodetxt.Clear;
distNameTxt.Clear;
end;
end;