Author: byterock
Date: Mon Dec 10 17:58:31 2007
New Revision: 10399

Modified:
   dbd-oracle/trunk/dbdimp.h
   dbd-oracle/trunk/oci8.c

Log:
to nights work not complete

Modified: dbd-oracle/trunk/dbdimp.h
==============================================================================
--- dbd-oracle/trunk/dbdimp.h   (original)
+++ dbd-oracle/trunk/dbdimp.h   Mon Dec 10 17:58:31 2007
@@ -165,6 +165,9 @@
        OCITypeCode     col_typecode;           /*if collection this is its 
OCI_ATTR_COLLECTION_TYPECODE */
     OCITypeCode        element_typecode;       /*if collection this is its 
element's OCI_ATTR_TYPECODE*/
        OCIRef          *obj_ref;                       /*if an embeded object 
this is ref handle to its TDO*/
+
+       dvoid                   **obj_instance;
+       dvoid                   *obj_ind;
        OCIComplexObject *obj_value;        /*the actual value from the DB*/
        OCIType         *obj_type;              /*if an embeded object this is 
the  OCIType returned by a OCIObjectPin*/
     fbh_obj_t       *fields;                   /*one object for each 
field/property*/

Modified: dbd-oracle/trunk/oci8.c
==============================================================================
--- dbd-oracle/trunk/oci8.c     (original)
+++ dbd-oracle/trunk/oci8.c     Mon Dec 10 17:58:31 2007
@@ -1384,7 +1384,7 @@
         dvoid   *addr_obj = (dvoid *)0;
        dvoid *nind = (dvoid *)0;
        sb4             *size;
-       if (DBIS->debug <= 5) {
+       if (DBIS->debug >= 5) {
                PerlIO_printf(DBILOGFP, " getting attributes of object named  
%s with typecode=%d\n",obj->type_name,obj->typecode);
        }
 
@@ -1395,17 +1395,21 @@
        case OCI_TYPECODE_OBJECT :                            /* embedded ADT */
 
 
-        for (pos = 0; pos < obj->field_count; pos++){
+       for (pos = 0; pos < obj->field_count; pos++){
                                fld = &obj->fields[pos]; /*get the field */
-                               
-                               
-                               
+
+/* status = OCITypeAttrs(fbh->imp_sth->envhp, obj->obj_type);*/
+
                                status = OCIObjectGetAttr(fbh->imp_sth->envhp, 
fbh->imp_sth->errhp, value,
-                                                                               
(dvoid *) 0, obj->obj_type,
+                                                                               
obj->obj_ind, obj->tdo,
                                                                                
&fld->type_name, &fld->type_namel, 1,
                                                                                
(ub4 *)0, 0, &attr_null_status, &attr_null_struct,
                                                                                
&attr_value, &attr_tdo);
 
+                                                                               
OCIObjectPin_log_stat(fbh->imp_sth->envhp,fbh->imp_sth->errhp, attr_tdo,(dvoid  
**)&obj->obj_type,status);
+                                                                               
PerlIO_printf(DBILOGFP, "OCIObjectPin_log_stat=%d\n",attr_null_status);
+
+PerlIO_printf(DBILOGFP, "attr_null_status=%d\n",attr_null_status);
                                if (status != OCI_SUCCESS) {
                                        oci_error(sth, fbh->imp_sth->errhp, 
status, "OCIObjectGetAttr");
                                        return 0;
@@ -1443,7 +1447,7 @@
                                case OCI_TYPECODE_TABLE :                       
/* nested table */
                                case OCI_TYPECODE_VARRAY :                    
/* variable array */
                                fld = &obj->fields[0]; /*get the field */
-           
+
                        OCIIterCreate_log_stat(fbh->imp_sth->envhp, 
fbh->imp_sth->errhp,
                        (CONST OCIColl*) value, &itr,status);
 
@@ -1460,10 +1464,8 @@
                                (dvoid **) &names_null, &eoc) && !eoc;)
                        {
 
-PerlIO_printf(DBILOGFP, " ping 2 null indicator is %d\n", *names_null);
-
                                                if (*names_null==OCI_IND_NULL){
-                                               
+
                                                     av_push(list,  &sv_undef);
                                                } else {
                                                        if 
(obj->element_typecode == OCI_TYPECODE_OBJECT){
@@ -1483,7 +1485,7 @@
                                                status = OCI_SUCCESS;
                                                return 0;
                                }
-                               break;    
+                               break;
                default:
                                break;
                }
@@ -1552,7 +1554,7 @@
                        if (obj->element_typecode == OCI_TYPECODE_OBJECT){
                                empty_oci_object(fld);
                        }
-                       if (SvTYPE(fld->value)){ 
+                       if (SvTYPE(fld->value)){
                                if (SvTYPE(fld->value) == SVt_PVAV){
                                        av_clear(fld->value);
                                        av_undef(fld->value);
@@ -1574,7 +1576,7 @@
        dTHX;
    if (fbh->obj){
                if(fbh->obj->value){
-               
+
                empty_oci_object(fbh->obj);
                }
        }
@@ -1716,15 +1718,39 @@
                }
                /*we will need a reff to the TDO for the pin operation*/
 
+
+
+status=OCIObjectNew (imp_sth->envhp,
+                     imp_sth->errhp,
+                     imp_sth->svchp,
+                    OCI_TYPECODE_OBJECT,
+                    obj->tdo,
+                    (dvoid *)0,
+                     OCI_DURATION_TRANS,
+                     1,
+                     obj->obj_instance );
+                     PerlIO_printf(DBILOGFP, "OCIObjectNew 
status=%d\n",status);
+
+
+ status=OCIObjectGetInd(imp_sth->envhp,imp_sth->errhp,obj->obj_instance,(dvoid 
 **) &obj->obj_ind);
+
+PerlIO_printf(DBILOGFP, "OCIObjectGetInd status=%d\n",status);
+
                OCIObjectPin_log_stat(imp_sth->envhp,imp_sth->errhp, 
obj->obj_ref,(dvoid  **)&obj->obj_type,status);
 
+
+               if (status != OCI_SUCCESS) {
+                       oci_error(sth,imp_sth->errhp, status, "OCIObjectPin");
+                       return 0;
+               }
+
+
                if (status != OCI_SUCCESS) {
                        oci_error(sth,imp_sth->errhp, status, "OCIObjectPin");
                        return 0;
                }
 
-               
-                        
+
                OCIAttrGet_parmdp(imp_sth,  obj->parmdp, (dvoid 
*)&obj->field_count,(ub4 *) 0, OCI_ATTR_NUM_TYPE_ATTRS, status);
 
                if (status != OCI_SUCCESS) {
@@ -1859,7 +1885,7 @@
 }
 
 
-       
+
 
 
 int
@@ -2165,8 +2191,8 @@
                    (ub2)fbh->ftype,
                    fb_ary->aindp,
                    (ftype==94||ftype==95) ? NULL : fb_ary->arlen,
-                   fb_ary->arcode, 
-                   OCI_DEFAULT, 
+                   fb_ary->arcode,
+                   OCI_DEFAULT,
                    status);
 
                if (fbh->ftype == 108)  { /* Embedded object bind it 
differently*/

Reply via email to