Click to See Complete Forum and Search --> : PHP4, OCI8 y varchar


Anon
06-27-2000, 02:36 PM
I'm sorry for my english ;-)

My host:

- Alpha Digital DEC-UNIX 4.0d
- Oracle Enterprise Server 8.0.5.1
- Netscape Enterprise Server 3.6.1
- PHP4 (running as CGI in Netscape)
--with-oracle
--with-oci8

Install process:

a) PHP install !100% OK!

b) I have problems with OCI8 functions executing PHP as CGI with varchar & char types -no returns any data- (with numbers or dates is fine). OCIFETCH & OCIRESULT not work with varchar? ;-(

c) Ah!, in command mode works, but in CGI mode not works.

d) Also, I must be insert in all codes:
putenv("ORACLE_HOME=/oracle/product/8.0.5");
putend("ORACLE_SID=demo");
It's necesary?

Thanks,

Anon
06-27-2000, 08:29 PM
I had the same problem and the conclusion i've is there is some problem OCI functions have with the "character set" defined in Oracle,check
"select * from nls_database_parameters" - logged in as system user in oracle
and check
NLS_CHARACTERSET (i've WE8ISO8859P9)
NLS_NCHAR_CHARACTERSET (i've WE8ISO8859P9)
and these are single byte/ASCII sets,
now i've another database with same nls parameters defined as US7ASCII and they work fine for OCIFETCH/OCIRESULT

but the previous case fails (if the length of the string stored in database is more than half of that defined - i.e if u have varchar2(20) and the string in DB is of length 8 - OCIFETCH would retrive it, but if length > 10, it would show blank....such frustrating problem !!!!)

anyway, there is no way u can change character set for DB once u've created it ...
one way to solve might me - recreate the DB or define the table columns with more width than necessary...

anyway..i'm not happy with OCI support of PHP for Oracle in general...

the PHP - ORA functions work well for the same case !!!!

best,
may this help u...
-ashish