declare
v_tbl_nm varchar2(30);
v_sql varchar2(4000);
v_result varchar2(4000);
begin
select table_name into v_tbl_nm from USER_TABLES where TABLE_NAME = (SELECT * FROM(SELECT concat(demo,'HISTORY') FROM HISTORY order by recordtime)where rownum=1);
v_sql :='select LYO_3_DB5_DBD84 from ' || v_tbl_nm ;
execute immediate v_sql into v_result;
dbms_output.put_line(v_result);
end;