arrays - How to get DBMS_ADDM report output through PHP -


i trying addm report oracle database. output in array fashion .txt. need display in table row format. i'm not getting desired output however.

  $today = date("his");   $taskname =$username.$today;   $taskquery = "begin dbms_addm.analyze_inst(:tname,     :bsnap,:esnap,:instnum);end;";   $stid = oci_parse($conn,$taskquery);   oci_bind_by_name($stid, ":tname", $taskname);   oci_bind_by_name($stid, ":bsnap", $bsnap);   oci_bind_by_name($stid, ":esnap", $esnap);   oci_bind_by_name($stid, ":instnum", $inst);   oci_execute($stid);   $mainquery = "select dbms_addm.get_report(:tname) dual";   $stid = oci_parse($conn,$mainquery);     oci_bind_by_name($stid, ":tname", $taskname);     oci_execute($stid);     echo "<table border='1'>\n";    while ($row = oci_fetch_array($stid, oci_assoc+oci_return_nulls)) {        echo "<tr>\n";       foreach ($row $item) {            echo "    <td>" . $item . "</td>\n";        }   echo "</tr>\n";   }   echo "</table>\n"; 

now returns error saying : object of class oci-lob not converted string

so tried var_dump after doing oci_fetch_all on $stid, , got this:

array (size=1)   'dbms_addm.get_report(:tname)' =>      array (size=1)       0 => string '          addm report task...and rest of report shows here' 

how can echo string shows report, because displays in proper format on shell. front end ui purpose.

i got answer on question. turns out shell_exec function of php fantastic job of doing simple cat command of txt file in linux format. output variable displays string, txt file, , shell_exec('cat filename')

so simple!!!


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -