Changeset 1594:a70d094e4f76


Ignore:
Timestamp:
02/23/10 12:27:28 (5 months ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
default
Message:

more oracle array stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/las2oci.cpp

    r1593 r1594  
    2020#include <algorithm> 
    2121#include <cctype> 
     22#include <cmath> 
    2223 
    2324#include <sys/stat.h> 
     
    480481    if (! gotdata) throw std::runtime_error("unable to fetch point data byte array"); 
    481482    b->blobs[index] = blob; 
     483    // FIXME: null srids not supported  
    482484    b->srids[index] = srid; 
    483485    b->gtypes[index] = gtype; 
     
    536538} 
    537539 
    538 bool BindBlock(OWStatement statement, blocks* b, OCILobLocator** locator) 
    539 { 
     540bool BindBlock(OWStatement* statement, blocks* b, OCILobLocator** locator, long commit_interval) 
     541{ 
     542    // oss << "INSERT INTO "<< table_name <<  
     543    //         "(OBJ_ID, BLK_ID, NUM_POINTS, POINTS,   " 
     544    //         "PCBLK_MIN_RES, BLK_EXTENT, PCBLK_MAX_RES, NUM_UNSORTED_POINTS, PT_SORT_DIM) " 
     545    //         "VALUES ( :1, :2, :3, :4, 1, mdsys.sdo_geometry(:5, :6, null,:7, :8)"  
     546    //         ", 1, 0, 1)";     
     547     
     548    // :1 
     549    statement->Bind( b->pc_ids ); 
     550     
     551    // :2 
     552    statement->Bind( b->block_ids ); 
     553 
     554    // :3 
     555    statement->Bind( b->num_points); 
     556        
     557    // :4 
     558    statement->Define( locator, (int)commit_interval );  
     559     
     560    long max_size = 0; 
     561    for (int i = 0; i < commit_interval; i++) { 
     562        max_size = std::max(max_size, (long)b->blobs[i]->size()); 
     563    } 
     564 
     565    statement->Bind((char*)b->blobs,(long)max_size);     
     566 
     567    // :5 
     568    statement->Bind(b->gtypes); 
     569 
     570    // :6 
     571    statement->Bind(b->srids);     
     572 
     573     
     574    // :7 
     575    // OCIArray* sdo_elem_info=0; 
     576    // connection->CreateType(&sdo_elem_info, connection->GetElemInfoType()); 
     577    // SetElements(statement, sdo_elem_info, bUseSolidGeometry);     
     578    // statement->Bind(&sdo_elem_info, connection->GetElemInfoType()); 
     579 
     580    // long* pc_ids; 
     581    // long* block_ids; 
     582    // long* num_points; 
     583    // std::vector<liblas::uint8_t>** blobs; 
     584    //  
     585    // long* srids; 
     586    // long* gtypes; 
     587    // OCIArray** element_arrays; 
     588    // OCIArray** coordinate_arrays; 
     589 
    540590    return true; 
    541591} 
Note: See TracChangeset for help on using the changeset viewer.