BDE Migration to UniDAC with Sybase
Thanks Alex.
Can you please let me know when you will be releasing the new build.
Also we have encounted another issue in TUniquery with creating temporary tables in tuniquery
for ex create table #tem1
insert #tem1
drop table #tem1
Please let us know can we perform actions on temporary table in Tuniquery
Thanks
AS
Can you please let me know when you will be releasing the new build.
Also we have encounted another issue in TUniquery with creating temporary tables in tuniquery
for ex create table #tem1
insert #tem1
drop table #tem1
Please let us know can we perform actions on temporary table in Tuniquery
Thanks
AS
Hello,
With the help of UniDAC, you can work with temporary ASE tables like with ordinary ones, for example:
The next build will be released next week.
With the help of UniDAC, you can work with temporary ASE tables like with ordinary ones, for example:
Code: Select all
var
UniConnection:TUniConnection;
UniQuery: TUniQuery;
begin
UniConnection:= TUniConnection.Create(nil);
try
UniConnection.ProviderName := 'ASE';
UniConnection.Server := 'SERVER';
UniConnection.Port:= 5000;
UniConnection.Username := 'sa';
UniConnection.Connect;
UniConnection.ExecSQL('create table #tem1(id integer)',[]);
UniConnection.ExecSQL('insert #tem1 values(1)',[]);
UniQuery:= TUniQuery.Create(nil);
try
UniQuery.Connection := UniConnection;
UniQuery.SQL.Text := 'select * from #tem1';
UniQuery.Open;
ShowMessage(UniQuery.FieldByName('id').AsString);
finally
UniQuery.Free;
end;
finally
UniConnection.Free;
end;Thanks Alex we will try the below. The existing add the entire query of creating,inserting and selecting the data inside the Tquery component. I will try spliting as you have show below.
Also, could you please let us know once the new build is available , we will download it and start using it . We have already got the license for unidac.
Regards,
AS
Also, could you please let us know once the new build is available , we will download it and start using it . We have already got the license for unidac.
Regards,
AS
Hello,
You can execute several commands with the help of TUniScript. You should separate them by ";", for example:
We plan to release the next build on Tuesday or Wednesday.
You can execute several commands with the help of TUniScript. You should separate them by ";", for example:
Code: Select all
UniScript1.SQL.Text := 'create table #tmp(id integer);' + #13 +
'insert into #tmp values(1);' + #13 +
'select * from #tmp;' + #13 +
'drop table #tmp;';
UniScript1.Execute;I cannot reproduce the problem. The code specified below works correctly (the number of records it returns is correct):
Please modify this code so that the error can be reproduced or provide your own example.
Code: Select all
create table t_test
(
id int,
text varchar(10)
)
insert into t_test values(1, 'test_1')
insert into t_test values(2, 'test_1')
insert into t_test values(3, 'test_1')
create procedure sp_test(@id int in)
as
create table #tmp (id int ,name varchar(10))
insert into #tmp select * from t_test where id >@id
select * from #tmp
drop table #tmp
Code: Select all
var
UniStoredProc: TUniStoredProc;
begin
UniStoredProc:= TUniStoredProc.Create(nil);
UniStoredProc.Connection:= UniConnection1;
UniStoredProc.StoredProcName := 'sp_test';
UniStoredProc.Prepare;
UniStoredProc.ParamByName('id').AsInteger := 1;
UniStoredProc.Open;
ShowMessage(IntToStr(TDataSet(UniStoredProc).RecordCount));
Please modify this code so that the error can be reproduced or provide your own example.
thanks alex..but when am trying this it is trowing error message like "Parameter '@id' is not declared as OUTPUT parameter"AlexP wrote:I cannot reproduce the problem. The code specified below works correctly (the number of records it returns is correct):
Code: Select all
create table t_test ( id int, text varchar(10) ) insert into t_test values(1, 'test_1') insert into t_test values(2, 'test_1') insert into t_test values(3, 'test_1') create procedure sp_test(@id int in) as create table #tmp (id int ,name varchar(10)) insert into #tmp select * from t_test where id >@id select * from #tmp drop table #tmpvar
UniStoredProc: TUniStoredProc;
begin
UniStoredProc:= TUniStoredProc.Create(nil);
UniStoredProc.Connection:= UniConnection1;
UniStoredProc.StoredProcName := 'sp_test';
UniStoredProc.Prepare;
UniStoredProc.ParamByName('id').AsInteger := 1;
UniStoredProc.Open;(here)
ShowMessage(IntToStr(TDataSet(UniStoredProc).RecordCount));
Please modify this code so that the error can be reproduced or provide your own example.
Hello,
Please try to set the type of the procedure parameter explicitly, like:
Please try to set the type of the procedure parameter explicitly, like:
Code: Select all
...
UniStoredProc.Prepare;
UniStoredProc.ParamByName('id').ParamType:= ptInput;
UniStoredProc.ParamByName('id').AsInteger := 1;
...
this got resloved i used saparate storedproc in each case..and i have removed Prepare also.AlexP wrote:Hello,
Please try to set the type of the procedure parameter explicitly, like:
Code: Select all
... UniStoredProc.Prepare; UniStoredProc.ParamByName('id').ParamType:= ptInput; UniStoredProc.ParamByName('id').AsInteger := 1; ...