Discussion:
Execute Block SQL error 901 ISC error 335544569
Jack Mills
2012-06-06 14:48:15 UTC
Permalink
I have a query that show the above error, yet runs OK when run from IBExpert.

EXECUTE BLOCK AS
declare variable D bigint; declare variable A bigint;
declare variable V integer; declare variable I bigint;
declare variable J bigint; declare variable X integer;
declare variable W integer; declare variable U integer;
begin
select first 1 (cast(DXS_NO as integer)) from IMPORT_DXS where Used = 'T' into i;
select max(cast(DXS_NO as integer)) from IMPORT_DXS where Used = 'T' into j;
while (i <= j)
do
begin
select cast(dxs_no as integer), cast(abs_no as integer), cast(Value1 as integer),
cast(uop as integer), cast(DB as integer), cast(DW as integer) from IMPORT_DXS
where :i = cast(dxs_no as integer) into d, a, v, u, x, w;
update DXS set ABS_NO = :a, Value1 = :v, USED = 'T', UOP = :u
where DX = :x and DW = :w;
i= i+1;
end
end

Prior to this query are 2 others. the 1st uses an execute block statement to delete IMPORT_DXS if it exists & the 2nd creates the IMPORT_DXS table from an external file, both of these run without errors.

Can anyone see where I'm going wrong?

Jack
ma_golyo
2012-06-06 14:54:27 UTC
Permalink
If you use IBX to connect then ParamCheck of TIBQuery should be FALSE.
Post by Jack Mills
I have a query that show the above error, yet runs OK when run from IBExpert.
EXECUTE BLOCK AS
declare variable D bigint; declare variable A bigint;
declare variable V integer; declare variable I bigint;
declare variable J bigint; declare variable X integer;
declare variable W integer; declare variable U integer;
begin
select first 1 (cast(DXS_NO as integer)) from IMPORT_DXS where Used = 'T' into i;
select max(cast(DXS_NO as integer)) from IMPORT_DXS where Used = 'T' into j;
while (i <= j)
do
begin
select cast(dxs_no as integer), cast(abs_no as integer), cast(Value1 as integer),
cast(uop as integer), cast(DB as integer), cast(DW as integer) from IMPORT_DXS
where :i = cast(dxs_no as integer) into d, a, v, u, x, w;
update DXS set ABS_NO = :a, Value1 = :v, USED = 'T', UOP = :u
where DX = :x and DW = :w;
i= i+1;
end
end
Prior to this query are 2 others. the 1st uses an execute block statement to delete IMPORT_DXS if it exists & the 2nd creates the IMPORT_DXS table from an external file, both of these run without errors.
Can anyone see where I'm going wrong?
Jack
Jack Mills
2012-06-07 08:37:51 UTC
Permalink
Post by ma_golyo
If you use IBX to connect then ParamCheck of TIBQuery should be FALSE.
Thanks for the response. That was the problem, now working fine.

Jack

Loading...