<html><head><title>Source for /oracle/demo/usertables.phps</title></head><body bgcolor="#FFFFFF" text="#000000">
&lt;html&gt;<br>&lt;title&gt;Demo:&nbsp;<FONT color="#0000BB">
&lt;?php&nbsp;<FONT color="#007700">echo</FONT>&nbsp;$PHP_SELF<FONT color="#007700">;</FONT>&nbsp;?&gt;</FONT>&lt;/title&gt;<br>&lt;body&nbsp;bgcolor="white"&gt;<br>&lt;h1&gt;<FONT color="#0000BB">
&lt;?php&nbsp;<FONT color="#007700">echo</FONT>&nbsp;$PHP_SELF<FONT color="#007700">;</FONT>&nbsp;?&gt;</FONT>&lt;/h1&gt;<br>&lt;hr&gt;<br>&lt;!--&nbsp;Demo&nbsp;begin&nbsp;--&gt;<br><FONT color="#0000BB">
&lt;?php<br>&nbsp;</FONT><I><FONT color="#FF8000" size="-1">
//&nbsp;Connect&nbsp;to&nbsp;Oracle&nbsp;using&nbsp;SID=&nbsp;$ORACLE_SID&nbsp;og&nbsp;$TWO_TASKS</FONT></I><FONT color="#0000BB">
<br>&nbsp;$con&nbsp;=&nbsp;OCILogon<FONT color="#007700">(</FONT><FONT color="#DD0000">
<STRONG>"scott"</STRONG></FONT>,<FONT color="#DD0000">
<STRONG>"tiger"</STRONG></FONT><FONT color="#007700">)</FONT><FONT color="#007700">;</FONT><br><br>&nbsp;</FONT><I><FONT color="#FF8000" size="-1">
//&nbsp;Get&nbsp;users&nbsp;tables</FONT></I><FONT color="#0000BB">
<br>&nbsp;$sql&nbsp;=&nbsp;<FONT color="#DD0000">
<STRONG>"select&nbsp;distinct&nbsp;tabs.table_name&nbsp;from&nbsp;user_tables&nbsp;tabs"</STRONG></FONT><FONT color="#007700">;</FONT><br>&nbsp;<FONT color="#007700">echo</FONT>&nbsp;<FONT color="#DD0000">
<STRONG>"SQL:&nbsp;"</STRONG></FONT>.$sql<FONT color="#007700">;</FONT><br>&nbsp;<FONT color="#007700">echo</FONT>&nbsp;<FONT color="#DD0000">
<STRONG>"&lt;p&gt;\n"</STRONG></FONT><FONT color="#007700">;</FONT><br><br>&nbsp;$stmt&nbsp;=&nbsp;OCIParse<FONT color="#007700">(</FONT>$con,&nbsp;$sql<FONT color="#007700">)</FONT><FONT color="#007700">;</FONT><br>&nbsp;OCIExecute<FONT color="#007700">(</FONT>$stmt<FONT color="#007700">)</FONT><FONT color="#007700">;</FONT><br><br>&nbsp;<FONT color="#007700">while</FONT>&nbsp;<FONT color="#007700">(</FONT>OCIFetchInto<FONT color="#007700">(</FONT>$stmt,&nbsp;&amp;$result,&nbsp;OCI_ASSOC<FONT color="#007700">)</FONT><FONT color="#007700">)</FONT>&nbsp;<FONT color="#007700">{</FONT><br>&nbsp;&nbsp;&nbsp;<FONT color="#007700">echo</FONT>&nbsp;$result[<FONT color="#DD0000">
<STRONG>'TABLE_NAME'</STRONG></FONT>]<FONT color="#007700">;</FONT><br>&nbsp;&nbsp;&nbsp;<FONT color="#007700">echo</FONT>&nbsp;<FONT color="#DD0000">
<STRONG>"&lt;br&gt;\n"</STRONG></FONT><FONT color="#007700">;</FONT><br>&nbsp;<FONT color="#007700">}</FONT><br><br>&nbsp;</FONT><I><FONT color="#FF8000" size="-1">
//&nbsp;Disconnect&nbsp;from&nbsp;Oracle</FONT></I><FONT color="#0000BB">
<br>&nbsp;OCILogoff<FONT color="#007700">(</FONT>$con<FONT color="#007700">)</FONT><FONT color="#007700">;</FONT><br>?&gt;<br></FONT>&lt;!--&nbsp;Demo&nbsp;end&nbsp;--&gt;<br>&lt;hr&gt;<br>&lt;i&gt;by&nbsp;Hans&nbsp;Schou&nbsp;&lt;a&nbsp;href="mailto:chlor@schou.dk"&gt;&amp;lt;chlor@schou.dk&amp;gt;&lt;/a&gt;&lt;/i&gt;<br>&lt;a&nbsp;href="http://www.schou.dk"&gt;http://www.schou.dk&lt;/a&gt;<br>&lt;br&gt;<br><FONT color="#0000BB">
&lt;?php<br>&nbsp;</FONT><I><FONT color="#FF8000" size="-1">
//&nbsp;Display&nbsp;source&nbsp;file&nbsp;if&nbsp;exists</FONT></I><FONT color="#0000BB">
<br>&nbsp;<FONT color="#007700">if</FONT>&nbsp;<FONT color="#007700">(</FONT>file_exists<FONT color="#007700">(</FONT>$fn&nbsp;=&nbsp;basename<FONT color="#007700">(</FONT>$PHP_SELF.<FONT color="#DD0000">
<STRONG>"s"</STRONG></FONT><FONT color="#007700">)</FONT><FONT color="#007700">)</FONT><FONT color="#007700">)</FONT><br>&nbsp;&nbsp;&nbsp;<FONT color="#007700">echo</FONT>&nbsp;<FONT color="#DD0000">
<STRONG>"&lt;i&gt;Source&nbsp;file:&nbsp;&lt;a&nbsp;href=\""</STRONG></FONT>.$fn.<FONT color="#DD0000">
<STRONG>"\"&gt;$fn&lt;/a&gt;&lt;/i&gt;\n"</STRONG></FONT><FONT color="#007700">;</FONT><br>&nbsp;<FONT color="#007700">else</FONT><br>&nbsp;&nbsp;&nbsp;<FONT color="#007700">echo</FONT>&nbsp;<FONT color="#DD0000">
<STRONG>"&lt;i&gt;Source&nbsp;file&nbsp;$fn&nbsp;is&nbsp;not&nbsp;available&lt;/i&gt;\n"</STRONG></FONT><FONT color="#007700">;</FONT><br>?&gt;<br></FONT>&lt;/body&gt;<br>&lt;/html&gt;<br>
</html>