About TUniScript TParams................
Posted: Thu 05 Jan 2012 07:13
Happy New year,devart!
develop environment:
delphi xe,unidac 4.1.3,firebird 2.5.1, User_ID is BigInt Field.
TUniScript SQL.Text:
delete from pwr_user_role where User_ID = :UID;
delete from pwr_user_action where User_ID = :UID;
insert into pwr_user_role(User_ID,Role_ID,IsValid)
select &User_ID,Role_ID,1 from pwr_user_role where User_ID = :UID2;
insert into pwr_user_action(User_ID,act_id)
select &User_ID,act_id from pwr_user_action where User_ID = :UID2;
Why not TUniScript can not find second param:UID2?I have already mentioned the same problem(BigInt Param),And you have fixed it with UniDAC 3.70.XXX?
delphi code:
procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
begin
//UniScript1.Params.`
UniScript1.Params.ParseSQL(UniScript1.SQL.Text,True);
// for i := 0 to UniScript1.Params.Count - 1 do
// ShowMessage(UniScript1.Params.Name); //count of param is 4
UniScript1.MacroByName('User_ID').Value := '12000';
UniScript1.Params.ParamByName('UID').Value := 12000;
UniScript1.Params.ParamByName('UID2').AsLargeInt := 1111111;
UniScript1.Execute;
ShowMessage('OK');
end;
SqlMonitor:
tfTransact:Start:
tfQExecute:delete from pwr_user_role where User_ID = :UID
:UID(Word)=12000
tfTransact:Commit:
tfTransact:Start:
tfQExecute:delete from pwr_user_action where User_ID = :UID
:UID(Word)=12000
tfTransact:Commit:
tfTransact:Start:
tfQExecute:insert into pwr_user_role(User_ID,Role_ID,IsValid)
select 12000,Role_ID,1 from pwr_user_role where User_ID = :UID2
:UID2(Unknown)=
tfTransact:Commit:
tfTransact:Start:
tfQExecute:insert into pwr_user_action(User_ID,act_id)
select 12000,act_id from pwr_user_action where User_ID = :UID2
:UID2(Unknown)=
tfTransact:Commit:
develop environment:
delphi xe,unidac 4.1.3,firebird 2.5.1, User_ID is BigInt Field.
TUniScript SQL.Text:
delete from pwr_user_role where User_ID = :UID;
delete from pwr_user_action where User_ID = :UID;
insert into pwr_user_role(User_ID,Role_ID,IsValid)
select &User_ID,Role_ID,1 from pwr_user_role where User_ID = :UID2;
insert into pwr_user_action(User_ID,act_id)
select &User_ID,act_id from pwr_user_action where User_ID = :UID2;
Why not TUniScript can not find second param:UID2?I have already mentioned the same problem(BigInt Param),And you have fixed it with UniDAC 3.70.XXX?
delphi code:
procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
begin
//UniScript1.Params.`
UniScript1.Params.ParseSQL(UniScript1.SQL.Text,True);
// for i := 0 to UniScript1.Params.Count - 1 do
// ShowMessage(UniScript1.Params.Name); //count of param is 4
UniScript1.MacroByName('User_ID').Value := '12000';
UniScript1.Params.ParamByName('UID').Value := 12000;
UniScript1.Params.ParamByName('UID2').AsLargeInt := 1111111;
UniScript1.Execute;
ShowMessage('OK');
end;
SqlMonitor:
tfTransact:Start:
tfQExecute:delete from pwr_user_role where User_ID = :UID
:UID(Word)=12000
tfTransact:Commit:
tfTransact:Start:
tfQExecute:delete from pwr_user_action where User_ID = :UID
:UID(Word)=12000
tfTransact:Commit:
tfTransact:Start:
tfQExecute:insert into pwr_user_role(User_ID,Role_ID,IsValid)
select 12000,Role_ID,1 from pwr_user_role where User_ID = :UID2
:UID2(Unknown)=
tfTransact:Commit:
tfTransact:Start:
tfQExecute:insert into pwr_user_action(User_ID,act_id)
select 12000,act_id from pwr_user_action where User_ID = :UID2
:UID2(Unknown)=
tfTransact:Commit: