TMSQuery.InsertSql exec :TestId = TestInsert :Description does not return data
Posted: Mon 08 Oct 2007 12:03
Hi,
We have are using Delphi 5 with version 3.8 and all of our projects work correctly. When we moved to the latest version 4.30 we do not get data back after performing an insert call.
To test the error we define in the database a table:
create table Test
(
TestId int identity(1,1),
Description nvarchar(50) not null
constraint PKTestId primary key(TestId)
)
create procedure TestInsert(@Description nvarchar(50))
as
begin
insert into Test(Description)
values (@Description)
return scope_identity()
end
create procedure TestSelectId(@TestId int)
as
begin
select
Test.TestId,
Test.Description,
Test.DBUserName,
Test.Dlc
from
Test
where
TestId=@TestId
end
The structure of TMSQuery is
Sql.Text = exec TestSelectId :TestId
SqlInsert = exec :TestId = TestInsert :Description
Options.QueryIdentity = False
Options.StrictUpdate = False
Options.NumberRange = True
Options.ReturnParams = True
After inserting a record the Field TestId is not set. In older versions the variable was set.
With kind regards,
Olivier Olmer
We have are using Delphi 5 with version 3.8 and all of our projects work correctly. When we moved to the latest version 4.30 we do not get data back after performing an insert call.
To test the error we define in the database a table:
create table Test
(
TestId int identity(1,1),
Description nvarchar(50) not null
constraint PKTestId primary key(TestId)
)
create procedure TestInsert(@Description nvarchar(50))
as
begin
insert into Test(Description)
values (@Description)
return scope_identity()
end
create procedure TestSelectId(@TestId int)
as
begin
select
Test.TestId,
Test.Description,
Test.DBUserName,
Test.Dlc
from
Test
where
TestId=@TestId
end
The structure of TMSQuery is
Sql.Text = exec TestSelectId :TestId
SqlInsert = exec :TestId = TestInsert :Description
Options.QueryIdentity = False
Options.StrictUpdate = False
Options.NumberRange = True
Options.ReturnParams = True
After inserting a record the Field TestId is not set. In older versions the variable was set.
With kind regards,
Olivier Olmer