Hello PHP mania,

I'm a newcomer right here, i just wanna ask a litle dummy question  :

I put the SQL below into my SQL Plus editor :

**************************
Select OSUSER

>From v$session

Where USERNAME = (Select USER From DUAL)

And AUDSID =(Select USERENV('SESSIONID') From DUAL)

*****************************

and it works with the output is my logon OS.

when I's connecting with PHP and ORACLE.DLL with the complete script below :

*****************************

<?php
PutEnv("ORACLE_SID=ORASID");
Putenv("ORACLE_HOME=c:\ORANT");

$connection = Ora_Logon ("blabla/blablabla@dbname","");
if ($connection == false){
  echo Ora_ErrorCode($connection).": ".Ora_Error($connection)."<BR>";
  exit;
}

$cursor = Ora_Open ($connection);
if ($cursor == false){
  echo Ora_ErrorCode($connection).": ".Ora_Error($connection)."<BR>";
  exit;
}

#check admin
$query = "Select OSUSER
>From v$session
Where USERNAME = (Select USER From DUAL)
And AUDSID =(Select USERENV('SESSIONID') From DUAL)  ";
$result = Ora_Parse ($cursor, $query);
if ($result == false){
  echo Ora_ErrorCode($cursor).": ".Ora_Error($cursor)."<BR>";
  exit;
}

$result = Ora_Exec ($cursor);
if ($result == false){
  echo Ora_ErrorCode($cursor).": ".Ora_Error($cursor)."<BR>";
  exit;
}

while (Ora_Fetch_Into ($cursor, &$values)){
    $admin = $values[0];
}
echo "<H2> USER Anda sekarang : $admin";
Ora_Close ($cursor);
Ora_Logoff ($connection);
?>

***************************

the error occured :

Warning: Ora_Parse failed (ORA-00942: table or view does not exist -- while
processing OCI function OPARSE) in c:\phpdev\www\project\test\osuser.php on
line 22
942: ORA-00942: table or view does not exist -- while processing OCI
function OPARSE

why its happen ?

in the right rule of oracle, if this table or view does not exist
(V$SESSION) my SQL will not work in SQL Plus editor.



Please, help me ASAP...

TIA,

edyk









-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to