[Liblas-commits] hg-main-tree: add support for fetching OCIArray* lengths

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Apr 5 17:46:26 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/269e8098b0a9
changeset: 499:269e8098b0a9
user:      Howard Butler <hobu.inc at gmail.com>
date:      Tue Apr 05 16:46:20 2011 -0500
description:
add support for fetching OCIArray* lengths

diffstat:

 apps/pc2pc.cpp                          |   2 +-
 include/libpc/drivers/oci/oci_wrapper.h |   1 +
 src/drivers/oci/Iterator.cpp            |   3 +++
 src/drivers/oci/oci_wrapper.cpp         |  14 ++++++++++++++
 4 files changed, 19 insertions(+), 1 deletions(-)

diffs (60 lines):

diff -r fbd1fc6c4e6e -r 269e8098b0a9 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Tue Apr 05 12:00:00 2011 -0500
+++ b/apps/pc2pc.cpp	Tue Apr 05 16:46:20 2011 -0500
@@ -131,7 +131,7 @@
         libpc::drivers::oci::Options options;
         boost::property_tree::ptree& tree = options.GetPTree();
         
-        boost::uint32_t capacity = 10000;
+        boost::uint32_t capacity = 12;
         tree.put("capacity", capacity);
         tree.put("connection", "lidar/lidar at 192.168.56.101/orcl");
         // tree.put("connection", "lidar/lidar at oracle.hobu.biz/crrel");
diff -r fbd1fc6c4e6e -r 269e8098b0a9 include/libpc/drivers/oci/oci_wrapper.h
--- a/include/libpc/drivers/oci/oci_wrapper.h	Tue Apr 05 12:00:00 2011 -0500
+++ b/include/libpc/drivers/oci/oci_wrapper.h	Tue Apr 05 16:46:20 2011 -0500
@@ -455,6 +455,7 @@
                             void* pBuffer, int nSize, unsigned int* nAmountRead );
     char*               ReadCLob( OCILobLocator* phLocator );
     unsigned long       GetBlobLength(OCILobLocator* phLocator);
+    signed long         GetArrayLength( OCIArray** ppoData);
     void                WriteCLob( OCILobLocator** pphLocator, char* pszData );
     bool                WriteBlob( OCILobLocator* phLocator,
                             void* pBuffer, int nSize );
diff -r fbd1fc6c4e6e -r 269e8098b0a9 src/drivers/oci/Iterator.cpp
--- a/src/drivers/oci/Iterator.cpp	Tue Apr 05 12:00:00 2011 -0500
+++ b/src/drivers/oci/Iterator.cpp	Tue Apr 05 16:46:20 2011 -0500
@@ -139,6 +139,9 @@
     
     std::cout << "elem1, elem2, elem3 " << elem1 << " " << elem2 << " " << elem3 << std::endl;
     
+    std::cout << "elem_info size " << m_statement->GetArrayLength(&(m_block->blk_extent->sdo_elem_info)) << std::endl;
+    std::cout << "sdo_ordinates size " << m_statement->GetArrayLength(&(m_block->blk_extent->sdo_ordinates)) << std::endl;
+
     std::cout.setf(std::ios_base::fixed, std::ios_base::floatfield);
     std::cout.precision(6);
     m_statement->GetElement(&(m_block->blk_extent->sdo_ordinates), 0, &x);
diff -r fbd1fc6c4e6e -r 269e8098b0a9 src/drivers/oci/oci_wrapper.cpp
--- a/src/drivers/oci/oci_wrapper.cpp	Tue Apr 05 12:00:00 2011 -0500
+++ b/src/drivers/oci/oci_wrapper.cpp	Tue Apr 05 16:46:20 2011 -0500
@@ -1516,6 +1516,20 @@
     }
 }
 
+signed long int OWStatement::GetArrayLength( OCIArray** ppoData)
+{
+    sb4            length;
+
+    if( CheckError( OCICollSize(
+        poConnection->hEnv,
+        hError,
+        (OCIColl*) *ppoData,
+        (sb4*) &length), hError ) ) 
+    {
+        return 0;
+    }
+    return length;
+}
 int OWStatement::GetElement( OCIArray** ppoData, int nIndex, int* pnResult )
 {
     boolean        exists;


More information about the Liblas-commits mailing list