0

Without using PHP, is there a way to grab data from a database table and transfer it into an html table? Here is my initial code, Please let me know if there are any more information I can provide, I am still new to stack overflow.

CREATE OR REPLACE package PCSPRO.SDRP15_Status_Report as

PROCEDURE ALFRED_proc1;


END SDRP15_STATUS_REPORT;
/ 
show errors;


----------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY pcspro.SDRP15_STATUS_REPORT AS

----------------------------------------------------------------------------------------------------------------

procedure alfred_proc1

is

begin 


HTP.P('

<HTML>
<BODY>
<table bgcolor="White"> Status Report
<b><font size="4" color=black>Submission Log</font></b>
<table bgcolor="black" width=1020 align="center" border="0"  cellspacing="1" class="sortable"><THEAD><tr bgcolor="#CCCCCC">
<th width=30 align=left><font size="2">DEL</font></th>
<th width=50 align=left><font size="2">EDT</font></th>

<th width=30 align=left><font size="2">Phase</font></th>
<th width=50 align=left><font size="2">State</font></th>
<th width=414 align=left><font size="2">CHG</font></th>
<th width=30 align=left><font size="2">Changes</font></th>
<th width=180 align=left><font size="2">Completed</font></th>
</table>

</BODY>
</HTML>

');

end alfred_proc1;

and my table is as follows:

SDRP15 table
   | phase |      |state|     |chg|
   ---------      -------     -----
       A          Maryland      Y
       V          New York      N
       A          Florida       N
3
  • 1
    Are you running Oracle on Android? Commented Sep 8, 2015 at 14:07
  • I am using MySQL as a compiler while using Toad for oracle to code for PLSQL and html/javascript Commented Sep 8, 2015 at 14:09
  • @jarlh On the plus side, it's more powerful than SQLite. On the minus side, this phone weighs a ton and a half and Oracle keep chasing me for a licence fee. Commented Sep 8, 2015 at 14:09

1 Answer 1

2

Yes it is possible, somthing along the lines of the below should work if you just want to create a table with values. So basicly craete a cursor at the top to retrieve the values from the database, then loop through the return and output the values.


CREATE OR REPLACE PACKAGE BODY pcspro.SDRP15_STATUS_REPORT AS

----------------------------------------------------------------------------------------------------------------

procedure alfred_proc1

is

cursor c_values is 
select phase, state, chg 
from   *yourtable*
where  *yourconditions*;

begin 


HTP.P('

<HTML>
<BODY>
<table bgcolor="White"> Status Report
<b><font size="4" color=black>Submission Log</font></b>
<table bgcolor="black" width=1020 align="center" border="0"  cellspacing="1" class="sortable"><THEAD><tr bgcolor="#CCCCCC">
<th width=30 align=left><font size="2">DEL</font></th>
<th width=50 align=left><font size="2">EDT</font></th>

<th width=30 align=left><font size="2">Phase</font></th>
<th width=50 align=left><font size="2">State</font></th>
<th width=414 align=left><font size="2">CHG</font></th>
<th width=30 align=left><font size="2">Changes</font></th>
<th width=180 align=left><font size="2">Completed</font></th> ');

for v_values in c_values loop 
   htp.p('<tr><td width=30 align=left></td>');
   htp.p('<td width=50 align=left></td>');
   htp.p('<td width=30 align=left>' || c_values.phase || '</td>');
   htp.p('<td width=50 align=left>' || c_values.state || '</td>');
   htp.p('<td width=414 align=left>' || c_values.change || '</td>');
   htp.p('<td width=30 align=left></td>');
   htp.p('<td width=180 align=left></td></tr>');

end loop;

htp.p('</table>    
</BODY>
</HTML>');

end alfred_proc1;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.