On Feb 22, 2006, at 12:00 PM, Stuart Children wrote:

Any chance you have an example of how to reproduce this? I'm not able to make this happen.

CREATE TABLE test_null_long (
        id NUMBER(38) PRIMARY KEY,
        other LONG
);
INSERT INTO test_null_long (id, other) values(1, 'one');
INSERT INTO test_null_long (id) values(2);
INSERT INTO test_null_long (id, other) values(3, 'three');
COMMIT;

Then in a template:

set result [ns_db exec $dbh "SELECT id, other FROM test_null_long ORDER BY id"]
set stmt_set [ns_db bindrow $dbh]
set numcols [ns_set size $stmt_set]
set i 0
while {[ns_db getrow $db $stmt_set]} {incr i}

...and hey presto, "Database operation "getrow" failed (exception 1405, "nsoracle.c:4031:Ns_OracleGetRow: error in `OCIStmtFetch ()': ORA-01405: fetched column value is NULL", where i is 1 (ie: whilst fetching the 2nd row).

FWIW, this is with a 10.2.0.1 client, and 8.1.7.4.0 server.


Excellent. Thanks. I actually did almost exactly this and it didn't produce an error. I recompiled the driver, restarted, and it started happening.

Anyway, this is fixed now. The LONG stuff is funky and does this weird piece-wise fetching. Before you actually fetch data you have to make a few OCI calls to set things up. One of these calls OCIStmtSetPieceInfo gives you the ability to provide a null indicator variable and that wasn't being provided. So I added that and it works like a charm now.

- Jeremy


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to