ORA-00904: invalid identifier

Solved
gamp -  
 X-DBA -
Hello,

I am developing an application in PHP with Oracle Database 10g Express Edition. I managed
to connect to the database but I am unable to interact with the tables. Here is my test code:

<?php // connection.php connects to the database. $username="HR"; $password="hr"; $db="//localhost/XE"; $conn = oci_connect($username, $password,$db); if ($conn) echo " connection OK"; else echo" bad"; $stmt = oci_parse($conn, "SELECT NOM FROM DBA_TABLES WHERE TABLE_NAME ='serge'"); $r=oci_execute($stmt); while ( $row = oci_fetch_assoc($stmt) ) { print_r($row); } oci_free_statement($stmt); oci_close($conn); ?> 

the result:

connection OK
Warning: oci_execute() [function.oci-execute]: ORA-00904: "NOM" : invalid identifier in E:\wamp\www\stage\essay.php on line 14

Warning: oci_fetch_assoc() [function.oci-fetch-assoc]: ORA-24374: definition not executed after fetch or execute and fetch in E:\wamp\www\stage\essay.php on line 16

Please help me.
Configuration: Windows XP / Internet Explorer 8.0

1 réponse

moderno31 Posted messages 900 Status Membre 92
 
invalid identifier: means that Oracle did not find a field named NAME in your table

And therefore, your mysql_fetch_assoc does not work
--
Moderno31
20
X-DBA
 
I didn't quite understand what GAMP wanted to do with the query. The NAME column is not a column in the DBA_TABLES system table. Anyway, it's July 2015, so his problem has probably been resolved.

He could initially replace his query with the simple query below that returns a list of table names:

"SELECT TABLE_NAME FROM DBA_TABLES"

Also, here is information about the ORA-00904 error: http://www.oracle-error.com/9i/ORA-00904.html
0