Re: FW: [PHP-DEV] OCIError patch

2002-03-13 Thread Daniel Ceregatti
DOH! I guess I made a few presumptions: 1) The user would never pass a NULL sql: $conn = OCILogon ("bla", "bla", "bla"); $sql = NULL; $stmt = OCIParse ($conn, $sql); OCIExecute ($stmt, OCI_DEFAULT); $error = OCIError ($stmt); <-- seg fault here print_r ($error); ?> This condition would caus

Re: FW: [PHP-DEV] OCIError patch

2002-03-13 Thread Daniel Ceregatti
This patch simply adds the original query text as the "sqltext" element and the error offset as the "offset" element. It was made against the latest CVS. Hopfully it'll suffice. If not, please let me know. Daniel Markus Fischer wrote: Of course the offset is fine. But if I were you,

Re: FW: [PHP-DEV] OCIError patch

2002-03-12 Thread Markus Fischer
Of course the offset is fine. But if I were you, I wouldn't put the asterisk into the sql statement; just provide the offset. _This_ is the greatest flexibility you can provide because all the information is passed unmodified to the developer. Serious environments need cus

Re: FW: [PHP-DEV] OCIError patch

2002-03-12 Thread Walter A. Boring IV
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

Re: FW: [PHP-DEV] OCIError patch

2002-03-12 Thread Daniel Ceregatti
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); //

Re: FW: [PHP-DEV] OCIError patch

2002-03-12 Thread Markus Fischer
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"

Re: FW: [PHP-DEV] OCIError patch

2002-03-12 Thread Daniel Ceregatti
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. Your thoug

Re: FW: [PHP-DEV] OCIError patch

2002-03-12 Thread Markus Fischer
I'm -indefinite until the html gets out of it. There are no error messages which do html on their own (if so, they are bogus and need to be fixed). Command line does not use .. anymore (has been fixed). On Tue, Mar 12, 2002 at 02:02:30PM -0800, Daniel Ceregatti wrote : > Hi, > >

Re: FW: [PHP-DEV] OCIError patch

2002-03-12 Thread Daniel Ceregatti
Hi, Andi, thanks for the feedback. I've changed the patch to include emalloc and efree. I actually use PHP from the command line a lot and I've noticed that warnings always get wrapped in , so I figured it was ok to do HTML here too. I've modified the patch to also include an "offset" element i