Venkat
Venkat

Reputation: 109

How to set up Oracle for PSPs

I am in the process of setting up Oracle for PSPs. I did the following already.

On DBA account

EXEC DBMS_EPG.CREATE_DAD('SCOTT_DAD', '/plsql/*');
EXEC DBMS_EPG.SET_DAD_ATTRIBUTE('SCOTT_DAD', 'database-username', 'SCOTT');
GRANT EXECUTE ON DBMS_EPG TO SCOTT;

On Scott

EXEC DBMS_EPG.AUTHORIZE_DAD('SCOTT_DAD');

Created a procedures on Scott with a name print_employees to print the employee names.

CREATE OR REPLACE PROCEDURE print_employees IS
  CURSOR emp_cursor IS
    SELECT EMPNO, ENAME
      FROM EMP
        ORDER BY EMPNO;
BEGIN
  HTP.PRINT('<html>');
  HTP.PRINT('<head>');
  HTP.PRINT('<meta http-equiv="Content-Type" content="text/html">');
  HTP.PRINT('<title>List of Employees</title>');
  HTP.PRINT('</head>'); 
  HTP.PRINT('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
  HTP.PRINT('<h1>List of Employees</h1>');
  HTP.PRINT('<table width="40%" border="1">');
  HTP.PRINT('<tr>');
  HTP.PRINT('<th align="left">Last Name</th>');
  HTP.PRINT('<th align="left">First Name</th>');
  HTP.PRINT('</tr>');
  FOR emp_record IN emp_cursor LOOP
    HTP.PRINT('<tr>');
    HTP.PRINT('<td>' || emp_record.EMPNO  || '</td>');
    HTP.PRINT('<td>' || emp_record.ENAME || '</td>');
  END LOOP;
  HTP.PRINT('</table>');
  HTP.PRINT('</body>');
  HTP.PRINT('</html>');
END;
/

But unfortunately, when I tested it with link as

https://localhost:port#/plsql/print_employees/

I am using the accurate port#, I am sure about it as my EM runs on the same and listener also up as I can access the database and EM.

Please help me if I am missing anything?

Upvotes: 0

Views: 54

Answers (0)

Related Questions