I like the idea of having the sqltext in the return array, as well as
the offset.  This is a very usefull tool for debugging oracle sql
queries.  I believe its something that OCIError has been lacking.
Anyone that uses Oracle along with sqlplus, you get the * under the 
broken portion of the query. I find it very usefull.  
  If there is a general rule of not putting html inside return values
for php internal functions, thats fine.  But I still want an easy way of
showing this type of info, without having to create my own wrapper
function call to OCIError, just so I can highlight the broken portion of
the query.

my $0.02
Walt

On Tue, 2002-03-12 at 15:08, Daniel Ceregatti wrote:
> 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?
> >
> 


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to