Subject how to use order by for selected record in insert
Author Mercea Paul
Hi

Using FB1.5 I need to copy records from one ID to another in same order
I have a procedure for copy that contains :
insert into rpr_com (code, order, complete_descr)
select :newid, c2.order, c2. complete_descr
from rpr_comp c2
where c2. code=:oldid;

I need to order the select by second column (order) ,something like:
insert into rpr_com (code, order, complete_descr)
select :newid, c2.order, c2. complete_descr
from rpr_comp c2
where c2. code=:oldid order by c2.order;

but I get compilation error when I save the procedure!

How can I insert ? (without using variables)

TIA,
Paul



[Non-text portions of this message have been removed]