1 Reply Latest reply: Oct 23, 2013 7:24 AM by 8a0d71bd-7f4b-4d4d-9529-d5e82bcde708 RSS

    Capturing cursor output in HTML format

    SagarMokashi

      Hi,

       

      I want to capture Cursor's output in html format.

      following is the current query which is giving me output as mentioned below it

       

      Query:-

      declare

      v_msgtext  varchar(4000);

       

      cursor c_query IS

      select emp_no,emp_name,salary

                from employees

                where dept_id = 100;

      begin

      for v_query in c_query LOOP

      v_msgtext = v_msgtext ||

                          'empno:'|| v_query.emp_no||','||

                          'emp_name:'||v_query.emp_name||'.'||

                          'emp_salary:'||'v_query.salary'||

                          char(13)||char(10);

      END LOOP;

      utl_mail.send(v_sender, v_recipient, NULL, NULL, v_subject, v_msgText, 'text/html; charset=windows-1250', NULL);

      end; 

       

      o/p:-

      empno: 123,emp_name:sagar,emp_salary:10,000

      empno: 124,emp_name:neeraj,emp_salary:20.000

      empno: 125,emp_name:ashish,emp_salary:18.000

      empno: 126,emp_name:ramesh,emp_salary:5.000

      empno: 127,emp_name:suresh,emp_salary:30.000

       

       

      I want to generate the output as HTML report in tabular format with the below columns

      (empno,emp_name,salary) and send this html file via email to user.

       

      Can anybody please suggest a solution ASAP.

       

      Thanks in advance.