It sounds as if you're trying to open a cursor based on a piece of SQL held in a string variable. You can do this using the "open cursor ...for..." command. Here's an example:

declare
type cv is ref cursor;
my_curs cv;
dummy varchar2(1);
procedure open_cursor (curs_text in varchar2,
curs_out in out cv) is
begin
open curs_out for curs_text;
end;
begin
open_cursor('select * from dual', my_curs);
fetch my_curs into dummy;
dbms_output.put_line(dummy);
close my_curs;
end;