Discussion:
err 365 are there any plans to remove this restriction??
(too old to reply)
Superboer
2011-11-27 15:55:08 UTC
Permalink
IBM Informix Dynamic Server Version 11.70.UC4IE

if i leave out the order by the spl works.. so
i guess order by is not allowed...??


create procedure tessie ()

define i int;
define f_lname like customer.lname;
define f_customer_num int;

foreach mycurr for select customer_num, lname into f_customer_num,
f_lname
from customer order by customer_num

update customer set lname = "x"|| trim (lname )
where current of mycurr;

end foreach;

end procedure;


execute procedure tessie();
365: Cursor must be on simple SELECT for FOR UPDATE.


Workaround would be:

create procedure tessie ()

define i int;
define f_lname like customer.lname;
define f_customer_num int;

foreach select customer_num, lname into f_customer_num, f_lname
from customer order by customer_num

update customer set lname = "x"|| trim (lname )
where customer_num = f_customer_num;

end foreach;

end procedure;


execute procedure tessie();

but that could cause deadlocks if one is not carefull...

one more, are there any plans to put the case statement from xps into
IDS??

comments are welcome

Superboer.
m***@gmail.com
2019-12-24 19:45:42 UTC
Permalink
Post by Superboer
IBM Informix Dynamic Server Version 11.70.UC4IE
if i leave out the order by the spl works.. so
i guess order by is not allowed...??
create procedure tessie ()
define i int;
define f_lname like customer.lname;
define f_customer_num int;
foreach mycurr for select customer_num, lname into f_customer_num,
f_lname
from customer order by customer_num
update customer set lname = "x"|| trim (lname )
where current of mycurr;
end foreach;
end procedure;
execute procedure tessie();
365: Cursor must be on simple SELECT for FOR UPDATE.
create procedure tessie ()
define i int;
define f_lname like customer.lname;
define f_customer_num int;
foreach select customer_num, lname into f_customer_num, f_lname
from customer order by customer_num
update customer set lname = "x"|| trim (lname )
where customer_num = f_customer_num;
end foreach;
end procedure;
execute procedure tessie();
but that could cause deadlocks if one is not carefull...
one more, are there any plans to put the case statement from xps into
IDS??
comments are welcome
Superboer.
Loading...