Re: Oracle/PHP unable to read VARCHAR2 from result buffer

From: Date: Fri, 24 Nov 2000 12:30:20 +0000
Subject: Re: Oracle/PHP unable to read VARCHAR2 from result buffer
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-4719@lists.php.net to get a copy of this message
There are translation functions for this in Oracle. There is a function named CONVERT which is probably what you want to use. Look at the oracle NLS manual for a listing of all charsets supported. - Gustaf Björklund At 12:58 2000-11-24, Peter Schupp wrote:
Hi out there, I use OCI-calls from PHP 3.0.12 with Oracle 8.0.5. Everything works fine (logon, select, ...) but it seems that I get UniCode-VARCHAR2 back from my result buffer which I'm not able to use directly.
   strlen(OCIResult($qstr, "surname"));         --- shows double (!!!)
the size of the containing string
   print "surname: " . OCIResult($qstr, "surname")      --- doesn't
print out anything When I copy OCIResult($qstr, "surname") to a string variable and access stringvar[1], ..[3], ... and so on I get my chars one after another, [0], [2], and so on are "0" (e.g. "PETER" is "\0P\0E\0T\0E\0R"). Numbers work fine!!! I expect NLS, UniCode ore any other Environmentals to be the problem. Does anybody have an concrete solution on that... Thanks for any help. Peter


« previous php.db (#4719) next »