Hm, quite a few issues... Here are my thoughts regarding one of them.

> > As Thies knows, I already proposed another important change, which is supporting 
>multiple character sets. This is very important on shared web platforms, and I have 
>experienced the trouble that arises from the way the oci ext treats the session 
>environment (-> as a global one).
> > Oracle 9i offers some functions which help out from this dilemma, and I have 
>changed the existing oci ext to support them. The most important change (from a 
>user's viewpoint) is that OCILogon has an optional forth parameter, the character 
>set, so an connection looks like this:
> > 
> > OCILogon($user,$pass,$tnsname,"WE8ISO8859P1");
> 
> > Ok, I know this isn't ideal, since OCILogon already has an optional parameter, but 
>maybe people can set $tnsname to false if they want to use the default one 
>(ORACLE_SID) and use a specific character set? Anyway, my code works, and is already 
>being used in a relativly big production environment.
> 
> Well, ideally, there would be a function for charset to be called before
> any OCIParse and set the charset. This would be:
> 
> 1. more flexible
> 2. would exclude non-authentication functionality with OCILogon
> 3. easier to find for a user
> 

Well basically, yes, I would prefer that solution, too. But: OCILogon not only 
connects to the database, it also opens the session, which is quite correct since a 
connection without a session isn't very useful. So either we make OCILogon *just* 
connect to the db and have a useless connection lying around until someone initializes 
the session (-> quite a bit to change + programming logic in php scripts broken, they 
would have to do two initialization steps), OR we initialize the session together with 
the connection (as is now) but have to provide the parameter at init time.

Wait, there is another possibility: perhaps we can have OCILogon use the global 
environment OCI(pEnv) to init the session (meaning that it uses the NLS_LANG 
settings), and then one can (not must) change the environment and from that moment on 
the new environment is used for the session. But this means we have to have a reliable 
switching mechanism between global and session-private environments, something I 
believe to be very tiresome...

Besides, we would then have a PHP function that can only be used with oracle 9i, 
whereas I would prefer to have a parameter that is only supported on such systems. 
Maybe just a matter of preference, but I feel that a function that is only available 
in certain compile situations isn't very elegant...?

BTW, currently the environment is init'd in php_oci_init_globals using the OCI 
function OCIEnvInit, which is deprecated. We should try to switch this to the more 
flexible (and supported) OCIEnvCreate - just as a small note ;-)

I included the patches (oci8.c and the corresponding .h) but please remember that 
currently you will need an Oracle 9i client to compile them (I still need to put some 
switches and fallback behaviours in there).

Cu all,
Abdul




>  
> > From a developers viewpoint what I mainly did was follow Thies' proposal and put 
>the environment struct in the session struct, and use the global env only for init 
>work. Then I decode the character set parameter (if it is omitted, the NLS_LANG 
>setting or Oracle default will be used) and use it in open_session. Voila, Oracle 
>takes care of the rest.
> > 
> > Works better than I thought :-). The only thing I need to do now is to add a 
>compile-time decision on whether Ora9i libraries are found or not, and then to make 
>this functionality available depending on the version. If anyone's interested I can 
>send a patch..
> 
> Well, let's ask Thies if he wants the patch, as I have no karma to php4 anyway :)
> 
> > As for the proposed name changes, IMHO it doesn't make that much of a sense, 
> > 1. since existing apps would have to be rewritten, and 
> 
> No way,I meant to drop the existing compatibility :). 
> 
> I'd keep the existing OCI8 extension, as well as I would keep ora_*
> functions. I would simply add the earlier suggested oracle_* functions
> to be something understood as a default Oracle extension similar to the
> way other DBs work. That's my idea. the -1's are that someone can get
> confused. But, nothing is free, I think a bit of confusion is the
> minimal expense for such functionality. it's already confusing anyway.
> 
> > 2. there is absolutely zero effectiveness in merging the ora_ and OCI
> > extensions, which differ greatly, into one. I think that would result
> > in a mess or a big rewrite..
> 
> Wouldn't it be better, though? Yes, perhaps it would be a big rewrite,
> but it would definitely create an actual Oracle extension, not
> two version-specific ones. Really, it is confusing.
> 
> Try imagine a similar situation:
> 
> Whoever pays Oracle license is planning something big and costly. A such
> "user" would have no much trouble paying also for Java or ASP, that
> support Oracle pretty well, but, should the corp. prefer PHP, they'd
> consider this more than once.
> 
> This is because they would be soon confused about how things are working
> between PHP and Oracle, what Oracle versions are supported and for how
> long...  Then, automatically (in some heads) answer arises: "Yeah, PHP
> is Open Source, it won't support well commercial third parties...".
> 
> That is why I think that unifying Oracle into something that looks and
> works just as other Open Source DBs can help PHP (5?) gain better trust
> and confidence from middle-large projects worldwide.
> 
> I have this theory not from air, but from my experience as a consultant trying
> propose PHP for Oracle Dbs :)
> 
> Maxim Maletsky
> [EMAIL PROTECTED]
> 
> 
> > Thx, Cu
> > Abdul
> > 
> > "Sebastian Nohn" <[EMAIL PROTECTED]> writes: 
> > 
> > >> 5. Functions are called OCI .* I do well know what it refers to, but
> > >> this is only because I learned the original oci.h API. Wouldn't itbe more
> > >> standard for PHP to use similar naming as mySQL, pgSQL, MSSQL extensions
> > >> ect? OCI make it a bit confusing, I always heard from my co-workers.
> > >> Besides, this can also be a great input for newer Oracle's updates.
> > > 
> > > This is mainly because there are Oracle-funktions and OCI-functions (there
> > > is a difference), and i like the OCI-thing very much, it's much easier and
> > > faster to type than oracle ;)
> > 
> > Well, yes, OCI* functions look pretty geek, indeed, they are very similar 
> > (if not identic, in some its parts) to the actual OCI API. 
> > 
> > But, this naming convention is way not optimal, is limited 
> > functionality-wise and, last but not least, it is far not PHP's standard 
> > naming convention for the database extensions. 
> > 
> > In fact, if you'll look into PHP standards specifications (look in CVS: 
> > http://cvs.php.net/co.php/php4/CODING_STANDARDS?login=2&r=1.23) you are 
> > encoraged using a certain style for calling your functions, especially those 
> > of databases since these mostly do the same things. 
> > 
> > What I meant was, while to access a mySQL database you use mysql_connect(), 
> > for PostgreSQL pg_connect() and for Sybase sybase_connect() question stays: 
> > why function to connect to Oracle be called OCILogon()? Wouldn't it be 
> > better called oracle_connect()? that is how som other programming languages 
> > call it. 
> > 
> > It is not an exaggeration to say that, some programmers are actually making 
> > their own functions named this very way so they can easier interact with the 
> > Oracle database using their mySQL's (or whatever) habbits because OCI gets 
> > them confused. I kind of followed this question within the PHP-Oracle 
> > developers I met. 
> > 
> > For now, we have ora_* and OCI* functions. These are, as long as I 
> > understand, used for Oracle v6.* and Oracle v8 (the last one is also 90% 
> > compatible with v9). Yet, this shouldn't mean that there is no need for a 
> > standarized set of functions like oracle_* with mapped/intuitive 
> > functionalities like most of the DBs PHP that supports AND as compatible 
> > between Oracle versions as possible. 
> > 
> > Only this way, one could firmly admit that PHP fully supports Oracle 
> > database. 
> > 
> > Those are my ideas for the Oracle extension. 
> > 
> > At this point, some new questions arised in my head: 
> > 
> > 1. Is ora_* extension (ext/oracle) still maintained and ported 
> > compatibility-wise to the versions Oracle newer v6 or, for these are OCI8 
> > extensions? If so, then this should mean that ora_* functions are limited to 
> > version 6 only, if not deprecated at all. Am I correct, or missed the point? 
> > If I guessed, then what was the need for OCI8 extyension at all? Why ora_* 
> > could not be continued? I still haven't found it out. 
> > 
> > 2. What costs merging the two extensions (ora_* and OCI8) in one (oracle_* 
> > ?) that fully supports both 6*, 8* and 9* versions of Oracle and remains the 
> > only one to be used (as well as maintained, debugged) in the feature? 
> > 
> > 3. Still, related to question 2: Wouldn't it be safe enough, if not rather 
> > strategically clever to introuduce the oracle_* new functions as a new 
> > unified extension for Oracle in all its versions within PHP 5? Considering, 
> > that we are still at the planning stage of its development release? 
> > 
> > Hope to see someone to anser, commenting my thoughts on this. I am very much 
> > willing contributing to the PHP's Oracle support development. 
> > 
> > 
> > Maxim Maletsky
> > [EMAIL PROTECTED] 
> > 
> > [EMAIL PROTECTED] schrieb am 15.10.02 17:32:17:
> > > Thanks, Andi.
> > > 
> > > yeah, I will wait for Thies to reply to me. We have sort of a started
> > > this discussion with him before, so hopefully he will join into this one.
> > > 
> > > My main concerns about OCI8 are the followings ones. Some of them are
> > > related to the opverall idea of PHP-DB usage, some to the actual
> > > performance and some to the missing functionalities. Some, might be
> > > bogus or hardly accomplisheble. Here's what I think:
> > > 
> > > 1. Datatype support. Right now, OCI8 only supports string and integer
> > > datatypes binded via PLSQL. It would be great being able to use all the
> > > remaining ones like booleans and dates, the other, incompatible onces
> > > might need to be translated into PHP's way so they can be used within
> > > PHP. Main problem of this is that, tipically, DBAs would grant the
> > > access via PLSQL (stored procedures) to a various number of clients,
> > > applications and langueages. Since, PHP does not funny support PLSQL,
> > > interfacing Oracle via PHP not having to change stored procedures is
> > > very limited.
> > > 
> > > 2. XMLTYPE. This is new since Oracle 9.2. Will all the XML fever of
> > > today, wouldn't it be possible to add some extra compatibility for it to
> > > stipulate Oracle users using PHP? Always if this is dopable and logical.
> > > 
> > > 3. Record type from Stored Procedures. (similar to #1) This is a VERY
> > > BIG limitation.  It is, probably, the 50% of the reason why PHP is not
> > > used much with Oracle.  Most programming languages can retrieve RECORD
> > > type from stored procs. and use it as arrays of data (like plain SQL
> > > records return). PHP fails on it, it only allows you to return the
> > > cursor, and for that you need to modify (descresing so performance) the
> > > stored procedures directly. At my work, (Italian Government) a datadase
> > > had over 500 stored procedures used via other programming languages. To
> > > migrate onto PHP, these all had to be changed and the backwards
> > > compatibility to the previous programming language was completely lost.
> > > It's a big issue.
> > > 
> > > 4. OCI8 module naming conventions. How come OCI module is named OCI8
> > > (specifically)? I think this makes it
> > > hard for many to believe that it can fully be compatible with upcoming
> > > releases of Oracle. Lots of businesses count a lot on application life-times
> > > and, seeing '8' (or so would be with '9') makes management feel that they
> > > might not be able to upgrade their expensive Oracle licences till PHP comes
> > > up with some newer number on the extension name. Which, in our case means
> > > changing the whole extension and, I really don't think we would be doing
> > > that too often. I personaly would see Oracle extension better with one only
> > > generic name like OCI, ora, oracle or whatever but not version-labeled.
> > > This could also help us keeping the OCI8 intact while adding newer
> > > changes.
> > > 
> > > 5. Functions are called OCI .* I do well know what it refers to, but
> > > this is only because I learned the original oci.h API. Wouldn't itbe more
> > > standard for PHP to use similar naming as mySQL, pgSQL, MSSQL extensions
> > > ect? OCI make it a bit confusing, I always heard from my co-workers.
> > > Besides, this can also be a great input for newer Oracle's updates.
> > > 
> > > Here's one of the sample bugs that can be occuring while continuing the
> > > current OCI8 extension with Oracle 9 and so on...
> > > 
> > > http://bugs.php.net/bug.php?id=18758
> > > 
> > > Hope, Thies and the rest of Dev Group can comment on my thought, and try
> > > to think of a way improving PHP's Oracle support so we can start working
> > > on it.  Btw, I do not have a karma for php4, so keep that in mind :) 
> > > 
> > > -- 
> > > Maxim Maletsky
> > > [EMAIL PROTECTED]
> > > 
> > > www.PHPBeginner.com  // where PHP Begins
> > > 
> > > 
> > > 
> > > Andi Gutmans <[EMAIL PROTECTED]> wrote... :
> > > 
> > > > Hey,
> > > > 
> > > > I'm sure that if there's work to be done people using Oracle will 
> > > > appreciate your contribution.
> > > > Personally, I don't use Oracle so I suggest you talk to Thies who's the 
> > > > maintainer of the extension about the things you feel are missing. (It can 
> > > > also be public here on php-dev if you need feedback from other users).
> > > > 
> > > > Andi
> > > > 
> > > > At 01:51 PM 10/15/2002 +0200, Maxim Maletsky wrote:
> > > > 
> > > > >Guys, a few month ago, I have been trying to offer some of my help for
> > > > >developing Oracle 9i extension, or in anyway, to improve the existing
> > > > >PHP/Oracle functionality.
> > > > >
> > > > >original posts are here: 
> > > > 
>>http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=aiquvp%2412e7%241%40FreeBSD.csie.NCTU.edu.tw&rnum=120&prev=/groups%3Fq%3DOCI8%2Bgroup:mailing.www.php-dev%26hl%3Den%26lr%3D%26ie%3DUTF-8%26scoring%3Dd%26start%3D110%26sa%3DN)
> > > > >
> > > > >
> > > > >Having put onto the real-life test OCI8 extensions for the Italian
> > > > >Government framework, I noticed many serious imperfections with the
> > > > >current OCI8 extension.
> > > > >
> > > > >I personally think that Oracle is very important for PHP's future, and
> > > > >that current extension is not very perfect and up to date.
> > > > >
> > > > >Please let me know if you are interested in my contributions regarding
> > > > >it.
> > > > >
> > > > >--
> > > > >Maxim Maletsky
> > > > >[EMAIL PROTECTED]
> > > > >
> > > > >
> > > > >--
> > > > >PHP Development Mailing List <http://www.php.net/>
> > > > >To unsubscribe, visit: http://www.php.net/unsub.php
> > > > 
> > > > 
> > > > -- 
> > > > PHP Development Mailing List <http://www.php.net/>
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > 
> > > 
> > > 
> > > -- 
> > > PHP Development Mailing List <http://www.php.net/>
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > 
> > 
> > 
> > 
> > 
> > -- 
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 

--- oci8.c      Wed Oct  9 16:38:05 2002
+++ oci8.c      Thu Sep 12 11:48:02 2002
@@ -199,7 +199,7 @@
 static oci_server *_oci_open_server(char *dbname,int persistent);
 static void _oci_close_server(oci_server *server);
 
-static oci_session *_oci_open_session(oci_server* server,char *username,char 
*password,int persistent,int exclusive,char *charset);
+static oci_session *_oci_open_session(oci_server* server,char *username,char 
+*password,int persistent,int exclusive);
 static void _oci_close_session(oci_session *session);
 
 static sb4 oci_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, 
dvoid **);
@@ -451,7 +451,7 @@
                                OCI_DEFAULT, 
                                0, 
                                NULL));
-                                       
+       
        CALL_OCI(OCIHandleAlloc(
                                OCI(pEnv), 
                                (dvoid **)&OCI(pError), 
@@ -631,7 +631,7 @@
 
        php_info_print_table_start();
        php_info_print_table_row(2, "OCI8 Support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.175 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.176 $");
 #ifndef PHP_WIN32
        php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
        php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -1158,9 +1158,9 @@
                        php_error(E_WARNING, "Unknown descriptor type 
%d.",Z_TYPE_P(descr));
                        return 0;
        }
-                               
+       
        CALL_OCI_RETURN(OCI(error), OCIDescriptorAlloc(
-                               connection->session->pEnv,
+                               OCI(pEnv),
                                (dvoid*)&(descr->ocidescr), 
                                Z_TYPE_P(descr), 
                                (size_t) 0, 
@@ -1244,7 +1244,7 @@
                        oci_debug("_oci_make_zval: %16s,retlen = %4d,retlen4 = 
%d,storage_size4 = %4d,indicator %4d, retcode = %4d",
                                          
column->name,column->retlen,column->retlen4,column->storage_size4,column->indicator,column->retcode);
        
-       if (column->indicator == -1) { /* column is NULL */
+       if ((! statement->has_data) || (column->indicator == -1)) { /* column is NULL 
+or statment has no current data */
                ZVAL_NULL(value); 
                return 0;
        }
@@ -1350,16 +1350,15 @@
 
        statement = ecalloc(1,sizeof(oci_statement));
 
-       //aan 220802 +13
     CALL_OCI(OCIHandleAlloc(
-                               connection->session->pEnv,
+                               OCI(pEnv),
                            (dvoid **)&statement->pStmt,
                                OCI_HTYPE_STMT, 
                                0, 
                                NULL));
 
     CALL_OCI(OCIHandleAlloc(
-                               connection->session->pEnv,
+                               OCI(pEnv),
                                (dvoid **)&statement->pError,
                                OCI_HTYPE_ERROR,
                                0,
@@ -1393,7 +1392,9 @@
        if (query) {
                statement->last_query = estrdup(query);
        }
+
        statement->conn = connection;
+       statement->has_data = 0;
 
        statement->id = zend_list_insert(statement,le_stmt);
 
@@ -1770,6 +1771,7 @@
                }
 
                statement->error = 0; /* OCI_NO_DATA is NO error for us!!! */
+               statement->has_data = 0;
 
                return 0;
        }
@@ -1829,12 +1831,16 @@
                        
_oci_make_zval(column->define->zval,statement,column,"OCIFetch",0 TSRMLS_CC);
                }
 
+               statement->has_data = 1;
+
                return 1;
        }
 
        oci_error(statement->pError, func, statement->error);
        oci_handle_error(statement->conn, statement->error);
 
+       statement->has_data = 0;
+
        return 0;
 }
 
@@ -1849,13 +1855,7 @@
        ub4 siz = 0;
        ub4 readlen = 0;
        char *buf;
-       char *convbuf;
-       ub2 testwert;
-       char charsetname[50] = "\0";
-       size_t *numconvbytes = 0;
-       size_t srcLen;
        TSRMLS_FETCH();
-       
 
        *loblen = 0;
        
@@ -1888,17 +1888,17 @@
        buf = emalloc(readlen + 1);
 
        while (readlen > 0) { /* thies loop should not be entered on readlen == 0 */
-                 CALL_OCI_RETURN(connection->error, OCILobRead(
+               CALL_OCI_RETURN(connection->error, OCILobRead(
                                        connection->pServiceContext, 
                                        connection->pError, 
                                        mydescr->ocidescr, 
-                                       &readlen,                                      
 /* IN/OUT bytes toread/read */
+                                       &readlen,                                      
+ /* IN/OUT bytes toread/read */ 
                                        siz + 1,                                       
 /* offset (starts with 1) */ 
                                        (dvoid *) ((char *) buf + siz), 
                                        readlen,                                       
 /* size of buffer */ 
                                        (dvoid *)0, 
                                        (OCICallbackLobRead) 0,         /* callback... 
*/ 
-                                       (ub2) connection->session->charsetId,          
                         /* The character set ID of the buffer data. */ 
+                                       (ub2) 0,                                       
+ /* The character set ID of the buffer data. */ 
                                        (ub1) SQLCS_IMPLICIT));         /* The 
character set form of the buffer data. */
 
                siz += readlen;
@@ -1911,7 +1911,7 @@
                        break;
                }
        }
-       
+
        if (connection->error) {
                oci_error(connection->pError, "OCILobRead", connection->error);
                oci_handle_error(connection, connection->error);
@@ -1936,11 +1936,11 @@
        buf = erealloc(buf,siz+1);
        buf[ siz ] = 0;
 
-       oci_debug("OCIloadlob: size=%d",siz);
-
        *buffer = buf;
        *loblen = siz;
 
+       oci_debug("OCIloadlob: size=%d",siz);
+
        return 0;
 }
 /* }}} */
@@ -2119,12 +2119,11 @@
 
  */
 
-static oci_session *_oci_open_session(oci_server* server,char *username,char 
*password,int persistent,int exclusive,char *charset)
+static oci_session *_oci_open_session(oci_server* server,char *username,char 
+*password,int persistent,int exclusive)
 {
        oci_session *session = 0, *psession = 0;
        OCISvcCtx *svchp = 0;
        char *hashed_details;
-       ub2 charsetid;
     TSRMLS_FETCH();
 
        /* 
@@ -2173,46 +2172,22 @@
        session->server = server;
        session->exclusive = exclusive;
 
-       //aan 170902 - testing
-       if (charset != "\0") {
-               //get ub2 charset id based on charset
-               CALL_OCI_RETURN(charsetid, OCINlsCharSetNameToId(
-                                                       OCI(pEnv),
-                                                       charset));
-               
-               session->charsetId = charsetid;
-               oci_debug("oci_do_connect: using charset id=%d",charsetid);
-       }
-       
-       CALL_OCI(OCIEnvNlsCreate(
-                               &session->pEnv,
-                               OCI_DEFAULT, 
-                               0, 
-                               NULL,
-                               NULL,
-                               NULL,
-                               0,
-                               NULL,
-                               charsetid,
-                               charsetid));
-
        /* allocate temporary Service Context */
-       //aan 220802 use private session
        CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
-                               session->pEnv, 
+                               OCI(pEnv), 
                                (dvoid **)&svchp, 
                                OCI_HTYPE_SVCCTX, 
                                0, 
-                               NULL)); 
+                               NULL));
        
        if (OCI(error) != OCI_SUCCESS) {
                oci_error(OCI(pError), "_oci_open_session: OCIHandleAlloc 
OCI_HTYPE_SVCCTX", OCI(error));
                goto CLEANUP;
        }
 
-       //aan 220802 use private session
+       /* allocate private session-handle */
        CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
-                               session->pEnv, 
+                               OCI(pEnv), 
                                (dvoid **)&session->pSession, 
                                OCI_HTYPE_SESSION, 
                                0, 
@@ -2330,7 +2305,7 @@
        if (session->is_open) {
                /* Temporary Service Context */
                CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
-                                       session->pEnv, 
+                                       OCI(pEnv), 
                                        (dvoid **) &svchp, 
                                        (ub4) OCI_HTYPE_SVCCTX, 
                                        (size_t) 0, 
@@ -2390,10 +2365,6 @@
                                        (ub4) OCI_HTYPE_SESSION));
        }
 
-       CALL_OCI(OCIHandleFree(
-                               (dvoid *)session->pEnv, 
-                               OCI_HTYPE_ENV));
-
        hashed_details = session->hashed_details;
 
        if (! OCI(shutdown)) {
@@ -2580,26 +2551,13 @@
  */
 static void oci_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent,int exclusive)
 {
-    char *username, *password, *dbname, *charset;
-    zval **userParam, **passParam, **dbParam, **charParam;
+    char *username, *password, *dbname;
+    zval **userParam, **passParam, **dbParam;
     oci_server *server = 0;
     oci_session *session = 0;
     oci_connection *connection = 0;
-
-        charset = "\0";   
-    //aan 170902 +9 if a forth parameter is handed over, it is the charset identifier
-    if (zend_get_parameters_ex(4, &userParam, &passParam, &dbParam, &charParam) == 
SUCCESS) {
-               convert_to_string_ex(userParam);
-               convert_to_string_ex(passParam);
-               convert_to_string_ex(dbParam);
-               convert_to_string_ex(charParam);
-
-               username = Z_STRVAL_PP(userParam);
-               password = Z_STRVAL_PP(passParam);
-               dbname = Z_STRVAL_PP(dbParam);
-               charset = Z_STRVAL_PP(charParam);
-               oci_debug("oci_do_connect: using charset=%s",charset);
-    } else if (zend_get_parameters_ex(3, &userParam, &passParam, &dbParam) == 
SUCCESS) {
+       
+    if (zend_get_parameters_ex(3, &userParam, &passParam, &dbParam) == SUCCESS) {
                convert_to_string_ex(userParam);
                convert_to_string_ex(passParam);
                convert_to_string_ex(dbParam);
@@ -2619,7 +2577,7 @@
     }
 
        connection = (oci_connection *) ecalloc(1,sizeof(oci_connection));
-       
+
        if (! connection) {
                goto CLEANUP;
        }
@@ -2638,8 +2596,7 @@
                persistent = server->persistent; 
        }
 
-       session = 
_oci_open_session(server,username,password,persistent,exclusive,charset);
-       
+       session = _oci_open_session(server,username,password,persistent,exclusive);
 
        if (! session) {
                goto CLEANUP;
@@ -3519,7 +3476,7 @@
             }
 
             connection->error = 
-                OCILobIsTemporary(connection->session->pEnv,
+                OCILobIsTemporary(OCI(pEnv),
                                   connection->pError,
                                   mylob,
                                   &is_temporary);
@@ -4644,7 +4601,7 @@
             oci_debug("OCIfreecollection: coll=%d",inx);
 
                        CALL_OCI_RETURN(connection->error, OCIObjectFree(
-                                               connection->session->pEnv, 
+                                               OCI(pEnv), 
                                                connection->pError, 
                                                (dvoid *)coll->coll, 
                                                (ub2)(OCI_OBJECTFREE_FORCE)));
@@ -4696,7 +4653,7 @@
                convert_to_string_ex(arg);
                if(Z_STRLEN_PP(arg) == 0) {
                        CALL_OCI_RETURN(connection->error, OCICollAppend(
-                                 connection->session->pEnv, 
+                                 OCI(pEnv), 
                                  connection->pError, 
                                  (dword *)0, 
                                  &null_ind, 
@@ -4729,7 +4686,7 @@
                           }
 
                           CALL_OCI_RETURN(connection->error, OCICollAppend(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   (dvoid *) &dt, 
                                                   (dvoid *) &new_ind, 
@@ -4745,7 +4702,7 @@
                           convert_to_string_ex(arg);
 
                           CALL_OCI_RETURN(connection->error, OCIStringAssignText(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   Z_STRVAL_PP(arg), 
                                                   Z_STRLEN_PP(arg), 
@@ -4757,7 +4714,7 @@
                           }
 
                           CALL_OCI_RETURN(connection->error, OCICollAppend(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   (dvoid *) ocistr, 
                                                   (dvoid *) &new_ind, 
@@ -4794,7 +4751,7 @@
                           }
 
                           CALL_OCI_RETURN(connection->error, OCICollAppend(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   (dvoid *) &num, 
                                                   (dvoid *) &new_ind, 
@@ -4842,7 +4799,7 @@
                connection = coll->conn;
 
                CALL_OCI_RETURN(connection->error, OCICollGetElem(
-                                       connection->session->pEnv, 
+                                       OCI(pEnv), 
                                        connection->pError, 
                                        coll->coll, 
                                        ndx, 
@@ -4882,7 +4839,7 @@
                           RETURN_STRINGL(buff,len,1);
                   case OCI_TYPECODE_VARCHAR2 :
                           ocistr = *(OCIString **)elem;
-                          str = OCIStringPtr(connection->session->pEnv,ocistr); /* 
XXX not protected against recursion! */
+                          str = OCIStringPtr(OCI(pEnv),ocistr); /* XXX not protected 
+against recursion! */
                           RETURN_STRINGL(str,strlen(str),1);
                           break;
                   case OCI_TYPECODE_UNSIGNED16 :                       /* UNSIGNED 
SHORT  */
@@ -4941,7 +4898,7 @@
                connection = coll->conn;
        
                CALL_OCI_RETURN(connection->error, OCICollAssign(
-                                       connection->session->pEnv,
+                                       OCI(pEnv),
                                        connection->pError, 
                                        from_coll->coll,
                                        coll->coll));
@@ -5001,7 +4958,7 @@
 
                if(Z_STRLEN_PP(val) == 0) {
                        CALL_OCI_RETURN(connection->error, OCICollAssignElem(
-                                 connection->session->pEnv, 
+                                 OCI(pEnv), 
                                  connection->pError, 
                                  ndx, 
                                  (dword *)0, 
@@ -5034,7 +4991,7 @@
                           }
 
                           CALL_OCI_RETURN(connection->error, OCICollAssignElem(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   ndx, 
                                                   (dword *)&dt, 
@@ -5050,7 +5007,7 @@
                           convert_to_string_ex(val);
 
                           CALL_OCI_RETURN(connection->error, OCIStringAssignText(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   Z_STRVAL_PP(val), 
                                                   Z_STRLEN_PP(val), 
@@ -5062,7 +5019,7 @@
                           }
 
                           CALL_OCI_RETURN(connection->error, OCICollAssignElem(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   ndx, 
                                                   (dword *)ocistr, 
@@ -5101,7 +5058,7 @@
                           }
 
                           CALL_OCI_RETURN(connection->error, OCICollAssignElem(
-                                                  connection->session->pEnv, 
+                                                  OCI(pEnv), 
                                                   connection->pError, 
                                                   ndx, 
                                                   (dword *)&num, 
@@ -5138,7 +5095,7 @@
                connection = coll->conn;
 
                CALL_OCI_RETURN(connection->error, OCICollSize(
-                                       connection->session->pEnv,
+                                       OCI(pEnv),
                                        coll->conn->pError,
                                        coll->coll,
                                        &sz));
@@ -5241,7 +5198,7 @@
        zend_list_addref(connection->id);
 
        CALL_OCI_RETURN(connection->error, OCITypeByName(
-                               connection->session->pEnv, 
+                               OCI(pEnv), 
                                connection->pError, 
                                connection->pServiceContext, 
                                ac==3?(text *)Z_STRVAL_PP(schema):(text *)0, 
@@ -5260,7 +5217,7 @@
     }
 
        CALL_OCI_RETURN(connection->error, OCIHandleAlloc(
-                               connection->session->pEnv, 
+                               OCI(pEnv), 
                                (dvoid **) &dschp1, 
                                (ub4) OCI_HTYPE_DESCRIBE, 
                                (size_t) 0, 
@@ -5344,7 +5301,7 @@
                   }
 
                   CALL_OCI_RETURN(connection->error, OCITypeByRef(
-                                          connection->session->pEnv, 
+                                          OCI(pEnv), 
                                           connection->pError, 
                                           coll->elem_ref, 
                                           OCI_DURATION_SESSION, 
@@ -5376,7 +5333,7 @@
 
        /* Create object to hold return table */
        CALL_OCI_RETURN(connection->error, OCIObjectNew(
-                               connection->session->pEnv, 
+                               OCI(pEnv), 
                                connection->pError, 
                                connection->pServiceContext, 
                                OCI_TYPECODE_TABLE, 
--- php_oci8.h  Wed Oct  9 16:38:11 2002
+++ php_oci8.h  Thu Sep 12 11:48:03 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_oci8.h,v 1.23 2002/02/10 12:41:52 thies Exp $ */
+/* $Id: php_oci8.h,v 1.24 2002/09/12 09:48:03 thies Exp $ */
 
 #if HAVE_OCI8
 # ifndef PHP_OCI8_H
@@ -69,10 +69,7 @@
        int exclusive;
        char *hashed_details;
        oci_server *server;
-       //aan 220802 +1
-       OCIEnv *pEnv;                           //sessions own environment
-       OCISession *pSession;   
-       ub2 charsetId;                          //sessions used character set (mostly 
this will be 0, so NLS_LANG will be used.
+       OCISession *pSession;
 } oci_session;
 
 typedef struct {
@@ -122,6 +119,7 @@
        HashTable *defines;
        int ncolumns;
        int executed;
+       int has_data;
        ub2 stmttype;
 } oci_statement;
 
@@ -185,7 +183,6 @@
     HashTable *server;
        HashTable *user;
 
-    //aan 220802 -1
     OCIEnv *pEnv;
 
        int in_call;
-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to