Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle12c PHP

artsunixlabsMar 1 2015 — edited Mar 3 2015

How can I properly describe the dollar sign in PHP ->> v$parameter

$sysparm = ("select * from v'$'parameter"); <-- First attempt

PHP Warning:  oci_execute(): ORA-00933: SQL command not properly ended in /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php on line 15

PHP Stack trace:

PHP   1. {main}() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:0

PHP   2. oci_execute() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:15

PHP Fatal error:  Could not execute statement: ORA-00933: SQL command not properly ended in /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php on line 18

PHP Stack trace:

PHP   1. {main}() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:0

PHP   2. trigger_error() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:18

oradba@solaris-slave:/var/apache2/2.2/cgi-bin$

==============================================================

                                                           CODE

==============================================================

<?php

$sysparm = ("select * from v'$'parameter");

$conn = oci_connect('system', 'welcome1', 'solaris-master:1521/x86artsdb');

if (!$conn) {

    $m = oci_error();

    trigger_error('Could not connect to database: '. $m['message'], E_USER_ERROR);

}

$s = oci_parse($conn, $sysparm);

if (!$s) {

    $m = oci_error($conn);

    trigger_error('Could not parse statement: '. $m['message'], E_USER_ERROR);

}

$r = oci_execute($s);

if (!$r) {

    $m = oci_error($s);

    trigger_error('Could not execute statement: '. $m['message'], E_USER_ERROR);

}

$r = oci_fetch_all($s, $res);

if (!$r) {

    $m = oci_error($s);

    trigger_error('Could not fetch rows: '. $m['message'], E_USER_ERROR);

}

echo "<table border='3'>\n";

foreach ($res as $row) {

    echo "$r";

    echo "<tr>\n";

    foreach ($row as $item) {

        echo "  <td>".($item!==null?htmlentities($item,

                       ENT_QUOTES):" ")."</td>\n";

    }

    echo "</tr>\n";

}

echo "</table>\n";

?>

===========================================================

This post has been answered by Christopher Jones-Oracle on Mar 2 2015
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 31 2015
Added on Mar 1 2015
2 comments
1,385 views