• Thanks for the quick response.

    I know that I can not use this kind of syntax but is there any other way of doing it without including the whole cursor declaration and the processing afterwards in the dynamic statement.

    Because the way I understand it the fetch will also have to be included in the dynamic statement and that is going to make things very difficult.

    Regards