Changeset 1588:653aa89e62a8


Ignore:
Timestamp:
02/22/10 07:45:19 (5 months ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
default
Message:

support NULLs in most Binds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/oci_wrapper.cpp

    r1587 r1588  
    568568        (ub4) nNextBnd, 
    569569        (dvoid*) pnData, 
    570         (sb4) sizeof(int), 
     570        (sb4) (pnData != NULL) ? (sb4)sizeof(int) : 0, 
    571571        (ub2) SQLT_INT, 
    572572        (void*) NULL, 
     
    585585    nNextCol++; 
    586586     
    587     sb4 s = -1; 
    588      
    589     if (pnData != NULL)  
    590         s = (sb4)sizeof(long); 
    591      
    592     printf("Setting size to %d\n", s); 
    593587    CheckError( OCIDefineByPos( hStmt, 
    594588        &hDefine, 
     
    596590        (ub4) nNextCol, 
    597591        (dvoid*) pnData, 
    598         (sb4) s, 
     592        (sb4) sizeof(long int), 
    599593        (ub2) SQLT_LNG, 
    600594        (void*) NULL, 
     
    610604    nNextBnd++; 
    611605     
    612     printf("Binding long column #: %d\n", nNextBnd); 
    613  
    614     sb4 s = 0; 
    615      
    616     if (pnData != NULL)  
    617         s = (sb4)sizeof(long int); 
    618      
    619     printf("Setting size to %d\n", s); 
    620606    CheckError( OCIBindByPos( 
    621607        hStmt, 
     
    624610        (ub4) nNextBnd, 
    625611        (dvoid*) pnData, 
    626         (sb4) s, 
     612        (sb4) (pnData != NULL) ? (sb4)sizeof(long int) : 0, 
    627613        (ub2) SQLT_INT, 
    628614        (void*) NULL, 
     
    646632        (ub4) nNextBnd, 
    647633        (dvoid*) pnData, 
    648         (sb4) sizeof(double), 
     634        (sb4) (pnData != NULL) ? (sb4)sizeof(double) : 0, 
    649635        (ub2) SQLT_BDOUBLE, 
    650636        (void*) NULL, 
Note: See TracChangeset for help on using the changeset viewer.