Yes. An example of what would be in the array returned by OCIError would be:

// Given the code below...

$conn = OCILogon (bla bla bla);

$sql = "select t.foo, t.bar from table t where t.id = 1";

$stmt = OCIParse ($conn, $sql);

OCIExecute ($stmt, OCI_DEFAULT);

$error = OCIError ($stmt);

// What follows are the values of the elements of the array returned by OCIError (presuming "bar" is an invalid column it the table):

$error["code"] = 904
$error["message"] = "ORA-00904: invalid column name"
$error["sqltext"] = "select t.foo, t.*bar from table t where t.id = 1"
$error["offset"] = 16

The PHP user then has the option of using either the "sqltext" element directly, or using the "offset" element and the $sql variable to create any output they see fit. I think this allows for the greatest felxibility, IMHO.

Daniel

Markus Fischer wrote:
On Tue, Mar 12, 2002 at 02:26:24PM -0800, Daniel Ceregatti wrote : 
How about doing what sqlplus does and simply add an asterisk at that 
point? I'm ok with rolling my own inside of the script by using the
offset element. I simply think it'll do PHP users a service to have the
"sqltext" in the array in _some_ form, even if only with an asterisk.

Asterisk at what point? Specified by offset?






Reply via email to