OCCI -getString problem

I'm having trouble executing code using the OCCI libraries.  I suspect that it's an issue with the version of OCCI that I'm using but can't seem to resolve the problem myself.
On Windows 7, I'm using the OCCI libraries from the Oracle Express 11.2 32 bit install.  I'm compiling in Eclipse Luna (for 32 bit) 1a using the CDT plugin.  I'm using the compiler from Microsoft Visual Studio 12.0.
I'm using the oraocci.lib. (If I use the oraocci11d.lib, my code crashes just trying to make a database connection.)  My current problem is with the oracle::occi::ResultSet::getString method.  If I call it once on my ResultSet, it works fine.  The second call causes my program to crash.
Here is my code:
std::sqlStr;
sqlStr = "SELECT START, END, BATCH_ID, AGENT_ID FROM AGENTS WHERE ID = :1";
connection code, stmt creation, etc
oracle::occi::ResultSet *rs = stmt->executeQuery();
if (rs->next()
   double start = rs->getDouble(1);
   double end = rs->getDouble(2);
   std::string batch = rs->getString(3);
   std::string agent = rs->getString(4);  // CRASH!
Here is the exception that I get when I try to debug:
"Unhandled exception at 0x00D82CB8 in DARTester.exe: 0xC0000005: Access violation reading location 0x0000005."
Any help would be greatly appreciated.

It is my fault. I use Fedore Core 4 and gcc4.0. By default it linking with libstdc++.6.so, but when I linkint direct with libstdc++.5.so it OK.
Thank you for support!

Similar Messages

  • OCCI-getString error

    The following is a small console program written with Visual C++
    6.0 sp 4.
    The program has a crash when it tries to destruct the
    string variable fodt in the while loop.
    Is this a known bug or is there an error in the code ?
    Bertil Reppen
    #include "stdafx.h"
    #include <iostream>
    //#include <string.h>
    #include <occi.h>
    using namespace std;
    using namespace oracle::occi;
    int main(int argc, char* argv[])
         const string username = "BERTIL";
         const string password = "REPPXX";
         const string url = "aoye.apintdom.no";
    Environment *env = Environment::createEnvironment (
    Environment::DEFAULT);
    try
              Connection *conn = env->createConnection
    (username, password, url);
              string sqlQuery = "SELECT pasientnr1,to_char
    (FODSELSDATO,'dd-mm-yyyy') FROM pasient_nr";
              Statement *stmt = conn->createStatement
    (sqlQuery);
              ResultSet *rs = stmt->executeQuery ();
              while (rs->next ())
                   long pasno = rs->getInt(1);
                   string fodt = rs->getString(2);
              stmt->closeResultSet (rs);
              conn->terminateStatement (stmt);
              env->terminateConnection (conn);
    catch (SQLException ea)
    cout << ea.what();
              catch (exception &excp)
         cout << excp.what() << endl;
    Environment::terminateEnvironment (env);
         return 0;

    Israel,
    Most of these errors do indeed arise from missing/wrong
    compilation flags/defines. Check out OCCI samples and
    the "make.bat" files in your %ORACLE_HOME%\rdbms\demo directory
    for the correct flags, includes, and libraries. Here is an
    example,
    :occimake
    cl -GX -DWIN32COMMON -I. -I%ORACLE_HOME%\oci\include -I. -D_DLL -
    D_MT %1.cpp /link /LIBPATH:%ORACLE_HOME%\oci\lib\msvc oci.lib
    msvcrt.lib msvcprt.lib oraocci9.lib /nod:libc
    Regards,
    Geoff
    the problem also occurs on VC 6.0 without any service pack.
    pay attention that the following expression:
    typeid(rs->getString(1)
    leads to a compiler internal error (getXXX other than string
    works just fine !!!).
    this, along with some other testings i've conducted might
    indicate that oraocci9.lib has been compiled with stl (or just
    string) which differs from the version supplied with msvc.
    it also can result from missing/wrong compilation flags/defines.
    i'm still working on this.
    if anyone finds the answer PLEASE contact me !!!
    regards,
    Israel Kalush

  • GetString-problem

    Hello!
    Help, i need somebody...
    I'm new in C++, VC and Oracle.
    I use OCCI to connect on 10g db. Somehow i configured VC so now i can create .exe. I'm not sure that i can repeat configuration:).
    In databes there is table whit only varchar2 fields. The problem is in this part of code:
    </br>
    string c2;</br>
         while(rs->next())</br>
    {            counter++;</br>
              for(int i=1; i<=5; i++) {</br>
                   c2=rs->getString(i);</br>
              cout <<"row: "<<counter<<" field: "<<i<<" "<<c2<<endl; </br>
         }</br>
              cout <<"******************"<<endl;</br>
    }</br>
    </br>
    Nothing smart. But when getString gets something it fails( An unhandled win32 exception occurred in my.exe [3888] . When i reduce dataset only on fiedls whit "where length(varchar_field)<16" it never throw this exception. If i
    Somethimes the program goes whitout any problem.
    Please help!!!
    I didn't find anything helpful on this forum.

    which version of OCCI are you using? Can you try on the latest version (10.2 or 10.1.0.5)?

  • Occi GetString causing a exception with ntdll.dll oracle 10g and MS 2005

    hi,
    I am getting an exception with using Visual Studio 2005(VC++8) and occi.h 10g client.
    When I run the release version I get an exception in ntdll.dll.
    The problem is in the getString(). The field in the oracle table is defined as a varchar2(300).
    I am new to oracle occi and need a solution because we cannot migrate to another version of the database.
    These are the solutions I have tried:
    download patches for MS Visual studio
    download patched for oracle 10g client
    Check that the charset it correct for std:string
    I see that others have had the same problem but no one has a solution. If anyone has a solution please email me because I have searched for days!
    Thanks
    Sheryl

    Aloha
    Thank you for your response, I am new to posting, occi and C++. Can I send you the files.
    Sorry didnt read this reply until today.
    The email is [email protected].
    This environment:
    1> windows xp
    2> MS Studio 5 VC++8
    3> OCCI 10.2.0.3.0 (patch 13)libraries for Microsoft Visual C++ 8
    4> I am using the Instant Client
    5> I am using /MD Multithreaded DLL
    6> Charset is oracle::occi::Environment::createEnvironment ("US7ASCII","AL16UTF16",Environment::DEFAULT);
    7> We running the application in release mode and getting this error with a bad memory reference on getString().
    I am getting a memory reference error on the getString(4).
    This is the code that is causing the error
    try
              string istmt ="SELECT FILE_ID,FILES.FTYP_ID,LTRIM(RTRIM(FILEPATH)),LTRIM(RTRIM(FILENAME)),TITLE FROM FILES,FILE_TYPES WHERE FILE_TYPES.EXTN = 'img'AND file_types.ftyp_id = files.ftyp_id AND FILES.HDR_SCAN_DATE IS NULL ORDER BY FILEPATH, FILENAME ";
              ResultSet * set = db->select(istmt);
              if (set == NULL)
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"No file to process occured in : %s ", methodName.c_str());
                   return;
              LogT::Get()->log(Logger::LOG_LEVEL_INFO,"Did select in : %s ", methodName.c_str());     
              while (set->next())
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"Doing a set next in : %s ", methodName.c_str());
                   if (set->isNull(1) || set->isNull(2) || set->isNull(4) || set->isNull(3))
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"a value is null continue in : %s ", methodName.c_str());
                        continue;
                   try {
                        LogT::Get()->log(Logger::LOG_LEVEL_INFO,"About to get string 3 in : %s ", methodName.c_str());
                        std::string test(set->getString(3));
                        fname.assign(test);
                        LogT::Get()->log(Logger::LOG_LEVEL_INFO,"File name: %s in : %s ",fname.c_str(), methodName.c_str());
                   } catch (exception ex9) {     
                        LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Exception in get string msg: occured in : %s ",ex9.what(), methodName.c_str());
                        continue;
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"getting int 1 in : %s ", methodName.c_str());
                   fid = set->getInt(1);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"getting string 4 in : %s ", methodName.c_str());
                   fn.assign(set->getString(4));
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"after getting string 4 in : %s ", methodName.c_str());
                   //dont append a slash if not need
                   size_t pos = fname.find_last_of("\\");
                   if(pos != fname.length()-1)
                        fname.append("\\");
                   fname.append(fn);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"adding %s to map in : %s ",fname.c_str(), methodName.c_str());
                   fnames.insert (std::pair<unsigned int,std::string>(fid,fname));
    //               int ftype = set->getInt(2);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"got fid:%d, fname:%s fn: %s to map in : %s ",fid,fname.c_str(),fn.c_str(), methodName.c_str());
         catch (SQLException ex)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Sql Exception code: %d message: %s occured in : %s ",ex.getErrorCode(),ex.getMessage().c_str(), methodName.c_str());
              db->exceptionHandler("SELECT PARAMS",ex.getErrorCode(),ex.getMessage());
              throw;
         catch (exception ex3)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Exception occured message: %sin : %s ", ex3.what(),methodName.c_str());
              db->exceptionHandler("SELECT PARAMS",1,ex3.what());
              throw;
         catch (...) {
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Error occured in : %s ", methodName.c_str());
    This is the code for the select in occi
    /* Select statement for oracle occi*/
    void * OraDb::select(std::string& sqlStr,std::map<std::string,VALUES,classcomp> & val) {
         string methodName = "OraDb::select";
         ResultSet *selectRset;
         try {
              this->stmt->setSQL(sqlStr);
              this->bind(val);
              selectRset = this->stmt->executeQuery ();
              oracle::occi::Statement::Status res = this->stmt->status();
              while(res != oracle::occi::Statement::RESULT_SET_AVAILABLE) {
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"the results set isnt ready");
                   res = this->stmt->status();
         catch (SQLException ex)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Sql Error in %s code: %d Message:%s",methodName.c_str(),ex.getErrorCode(),ex.getMessage().c_str());
              //Add error to error log                          
              this->exceptionHandler(methodName,ex.getErrorCode(),ex.getMessage());
              throw;
         catch (exception ex3)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Error in %s Message:%s",methodName.c_str(),ex3.what());
              this->exceptionHandler(methodName,1,ex3.what());
              //Add error to errorlog
              throw;
    return selectRset;
    This is the logs I get
    ParamsTb::selectImgParams
    in method OraDb::select this is the statement:SELECT FILE_ID,FILES.FTYP_ID,LTRIM(RTRIM(FILEPATH)),LTRIM(RTRIM(FILENAME)),TITLE FROM FILES,FILE_TYPES WHERE FILE_TYPES.EXTN = 'img'AND file_types.ftyp_id = files.ftyp_id AND FILES.HDR_SCAN_DATE IS NULL
    Did select in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\\foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    got fid:4766408, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\\foeHeaderAirplane.img fn: foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\\foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    got fid:4778728, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\\foeHeaderAirplane.img fn: foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\\netwlan5.img to map in : FilesTb::selectImgFiles
    got fid:4873869, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\\netwlan5.img fn: netwlan5.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\rwolfshagen\c\Resp-C4\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    I dumped a few things from last night’s Dr. Watson run, shown below, which may help:
    manifest.txt
    Server=watson.microsoft.com
    UI LCID=1033
    Flags=1672016
    Brand=WINDOWS
    TitleName=ImgHeaderLoader.exe
    DigPidRegPath=HKLM\Software\Microsoft\Windows NT\CurrentVersion\DigitalProductId
    ErrorText=This error occurred on 6/25/2009 at 1:47:02 AM.
    HeaderText=ImgHeaderLoader.exe encountered a problem and needed to close.
    Stage1URL=/StageOne/ImgHeaderLoader_exe/0_0_0_0/ntdll_dll/5_2_3790_4455/0002b67d.htm
    Stage2URL=/dw/stagetwo.asp?szAppName=ImgHeaderLoader.exe&szAppVer=0.0.0.0&szModName=ntdll.dll&szModVer=5.2.3790.4455&offset=0002b67d
    DataFiles=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\ImgHeaderLoader.exe.mdmp|C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\appcompat.txt
    Heap=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\ImgHeaderLoader.exe.hdmp
    ErrorSubPath=ImgHeaderLoader.exe\0.0.0.0\ntdll.dll\5.2.3790.4455\0002b67d
    DirectoryDelete=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00
    appcompat.txt
    <?xml version="1.0" encoding="UTF-16"?>
    <DATABASE>
    <EXE NAME="ImgHeaderLoader.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="common.dll" SIZE="6656" CHECKSUM="0xA0D33EDD" MODULE_TYPE="WIN32" PE_CHECKSUM="0x8ADC" LINKER_VERSION="0x0" LINK_DATE="06/25/2009 00:44:47" UPTO_LINK_DATE="06/25/2009 00:44:47" />
    <MATCHING_FILE NAME="FileLoader.exe" SIZE="65536" CHECKSUM="0x15C68C49" MODULE_TYPE="WIN32" PE_CHECKSUM="0x16CC5" LINKER_VERSION="0x0" LINK_DATE="06/23/2009 02:29:33" UPTO_LINK_DATE="06/23/2009 02:29:33" />
    <MATCHING_FILE NAME="FileLoaderOriginal.exe" SIZE="65536" CHECKSUM="0x6672AE23" MODULE_TYPE="WIN32" PE_CHECKSUM="0x17E45" LINKER_VERSION="0x0" LINK_DATE="06/20/2009 03:34:40" UPTO_LINK_DATE="06/20/2009 03:34:40" />
    <MATCHING_FILE NAME="ImgHeaderLoader.exe" SIZE="118784" CHECKSUM="0xBA94D6AE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x20F4B" LINKER_VERSION="0x0" LINK_DATE="06/24/2009 22:42:49" UPTO_LINK_DATE="06/24/2009 22:42:49" />
    <MATCHING_FILE NAME="x.exe" SIZE="65536" CHECKSUM="0x66982AE3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x103FD" LINKER_VERSION="0x0" LINK_DATE="06/18/2009 23:55:27" UPTO_LINK_DATE="06/18/2009 23:55:27" />
    </EXE>
    <EXE NAME="ntdll.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="ntdll.dll" SIZE="774144" CHECKSUM="0x74ACB78F" BIN_FILE_VERSION="5.2.3790.4455" BIN_PRODUCT_VERSION="5.2.3790.4455" PRODUCT_VERSION="5.2.3790.4455" FILE_DESCRIPTION="NT Layer DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.2.3790.4455 (srv03_sp2_gdr.090203-1205)" ORIGINAL_FILENAME="ntdll.dll" INTERNAL_NAME="ntdll.dll" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xC2B9D" LINKER_VERSION="0x50002" UPTO_BIN_FILE_VERSION="5.2.3790.4455" UPTO_BIN_PRODUCT_VERSION="5.2.3790.4455" LINK_DATE="02/09/2009 11:02:56" UPTO_LINK_DATE="02/09/2009 11:02:56" VER_LANGUAGE="English (United States) [0x409]" />
    </EXE>
    <EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="1038336" CHECKSUM="0x7EFD9E0D" BIN_FILE_VERSION="5.2.3790.4480" BIN_PRODUCT_VERSION="5.2.3790.4480" PRODUCT_VERSION="5.2.3790.4480" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.2.3790.4480 (srv03_sp2_gdr.090321-1244)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x101B44" LINKER_VERSION="0x50002" UPTO_BIN_FILE_VERSION="5.2.3790.4480" UPTO_BIN_PRODUCT_VERSION="5.2.3790.4480" LINK_DATE="03/21/2009 17:08:26" UPTO_LINK_DATE="03/21/2009 17:08:26" VER_LANGUAGE="English (United States) [0x409]" />
    </EXE>
    </DATABASE>
    THANKS!!!!!

  • OCCI ResultSet problems

    Hi!
    My problem is the same as this thread.
    OCCI programming
    I call the method getColumnListMetaData and the method returns a STL vector with
    Metadata objects and it works fine. My problem is when the vector should be deallocated.
    When I run the testprogram a get this error message:
    *** glibc detected *** double free or corruption (!prev): 0x08121568 ***
    The sample code....
    vector<MetaData> md = rs->getColumnListMetaData();
    //column names to number mapping
    map<string, int> columns;
    for (int i = 0; i < md.size(); i++)
         columns[md[ i ].getString(MetaData::ATTR_NAME)] = i;
    My versions:
    CentOS release 4.2 (Final)
    Kernel 2.6.9-34.EL
    gcc version 3.4.4
    OCCI 10g Release 2 (10.2)

    Code:
    int test(int argc, char **argv)
         const string userName = ".........";
         const string password = "....";
         const string connectString = "..";
         Environment *env = Environment::createEnvironment();
              Connection *conn = env->createConnection(
                   userName, password, connectString);
              Statement *stmt = conn->createStatement(
                   "SELECT * FROM TEST_TABLE");
              ResultSet *rs = stmt->executeQuery();
              vector<MetaData> md = rs->getColumnListMetaData();
              //column names to number mapping
              map<string, int> columns;
              for (int i = 0; i < md.size(); i++)
                   columns[md[ i ].getString(MetaData::ATTR_NAME)] = i;
    cout << "Column name: " << md[0].getString(MetaData::ATTR_NAME) << endl;
              stmt->closeResultSet(rs);
              conn->terminateStatement(stmt);
              env->terminateConnection(conn);
    Environment::terminateEnvironment(env);
    return 0;
    Output:
    Column name: ID
    *** glibc detected *** double free or corruption (!prev): 0x08c52568 ***
    Aborted

  • OCCI Link Problem

    Hi,
    I am using Oracle 9.2.0.1.0, Redhat 9, gcc 2.96, glibc 2.3.2-11.9. I continually receive the following link problem:
    /usr/bin/ld: warning: libclntsh.so, needed by /opt/ora9/product/9.2//lib/libvdc.so, not found (try using -rpath or -rpath-link)
    /opt/ora9/product/9.2//lib/libocci9.a(occiUtil.o)(.text+0x99f): In function `oracle::occi::toUpperCase(basic_string&lt;char, string_char_traits&lt;char&gt;, __default_alloc_template&lt;true, 0&gt; &gt; const &)':
    : undefined reference to `__ctype_toupper'
    collect2: ld returned 1 exit status
    Can anyone assist in resolving this issue?
    Thanks
    JD

    Removed libocci9 and it compiled.
    JD

  • OCCI link problem with gcc2.96 in Redhat7.2, Oracle9.0.1

    When I compiled and linked the occi program occidml.cpp with dynamic shared library, all was OK.
    But when occidml run, segmentation fault happened.
    I'v read a topic that we can build the program with static library to avoid segmentation fault.
    So, I recompiled the program and I used the following command to relink it.
    /usr/bin/g++ -L/ora9/lib/ -L/ora9/rdbms/lib/ -o occidml occi
    dml.o -lclntst9 -locci9 -ldl -lm
    But, a lots of errors happened:
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etNull(void)':
    occiAnyDataImpl.o(.text+0x2c2c): undefined reference to `OCIAnyDataConvert'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::g
    etDate(void) const':
    occiAnyDataImpl.o(.text+0x2cba): undefined reference to `OCIAnyDataAttrGet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etBlob(oracle::occi::Blob const &)':
    occiAnyDataImpl.o(.text+0x2d83): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etClob(oracle::occi::Clob const &)':
    occiAnyDataImpl.o(.text+0x2e13): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etBfile(oracle::occi::Bfile const &)':
    occiAnyDataImpl.o(.text+0x2ea9): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etNumber(oracle::occi::Number const &)':
    occiAnyDataImpl.o(.text+0x2f4c): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etDate(oracle::occi::Date const &)':
    occiAnyDataImpl.o(.text+0x2ff3): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o)(.text+0x30b8): more undefined references t
    o `OCIAnyDataAttrSet' follow
    Who can help me ? Is the static library libocci9.a with any problem?

    I tried clicking on the link and nothing whatsoever happened. So I tried a control click and selected "Open Link in new window" and a new window opened, followed by the Utilities folder opening. I made a test.html file with the link in it, put it on my startup drive and it worked as expected, and ditto for putting it on a second internal drive. I then put it on my iDisk and navigated to it thru its web site address of
    http://homepage.mac.com/francines/testlinks.html
    and discovered that the two other "local" operation links (to launch ScriptEditor) both worked, but the open folder link no longer did, except by using control click and choosing either "Open link in new window" or new tab. A new Safari window or tab opens, then the Utilities folder opens.
    I then tried the page in Firefox, and it didn't work AT ALL, not even with new window or tab. I then tried Mozilla and Netscape. Same deal. The ancient Internet Explorer opened the Utilities folder inside a new browser window rather than the Finder. This might be a clue as to why the link doesn't work as expected, but unfortunately I don't know what it means.
    Francine

  • OCCI version problem

    Hi,
    I am having a version problem with 9i.
    How can i compile OCCI with 9i database installetion?
    Which library would i need?
    my server is a SOL-Sparc-64 machine
    and oracle database server is installed there versiion oracle 9i 32bit.
    I tried to compile but it gives me error like....
    Undefined first referenced
    symbol in file
    main /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/crt1.o
    __1cG__CrunKpure_error6F_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdbC__RTTI__1nDstdMlength_error__ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMout_of_range2T6M_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2G6Mpkc_r1_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cG__CrunIex_alloc6FI_pv_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cG__CrunIex_throw6Fpvpkn0AQstatic_type_info_pF1_v_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2G6Mrk1_r1_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2t6MpkcIrkn0C__v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cH__rwstdRexcept_msg_string2t6MIE_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    Please tell me how to do it.
    Edited by: user652233 on Oct 16, 2008 1:18 AM

    Hello,
    I am trying to compile my C++ code (using OCCI) on Sun Solaris 5.9 (SPARC64PLUS) environment.
    We have compiled and tested it on RHEL 5 Linux.
    The Oracle (10g R3) database is on RHEL 5 server while OCCI/C++ application would be running on Sun Solaris 5.9 server.
    Since we have no Oracle installation on the Sun Solaris 5.9 server, there are no OCCI related libraries on this server and hence we are not able to compile our C++ code on Sun Solaris 5.9
    Can someone help me on how/where to download OCCI libraries (compile time as well as run time) for Solaris 5.9 ? I could find only Windows and RHEL versions of OCCI libraries on the Oracle website.
    Also, how stable is OCCI on Solaris 5.9 ?
    Regards,

  • OCCI Link problem (Error LNK2019: unresolved external symbol) in VS2012

    Hi,
    I'm having a hard time with this. I'm trying to implement OCCI within my application. Error I'm getting is:
    Error     1     error LNK2019: unresolved external symbol "public: static class oracle::occi::Environment * __cdecl oracle::occi::Environment::createEnvironment(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum oracle::occi::Environment::Mode,void *,void * (__cdecl*)(void *,unsigned int),void * (__cdecl*)(void *,void *,unsigned int),void (__cdecl*)(void *,void *))" (?createEnvironment@Environment@occi@oracle@@SAPAV123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0W4Mode@123@PAXP6APAX2I@ZP6APAX22I@ZP6AX22@Z@Z) referenced in function "private: bool __thiscall ServerDataLoader::getPreSuffixesFromDB(void)" (?getPreSuffixesFromDB@ServerDataLoader@@AAE_NXZ)     P:\code\VizTool\VizPortal\DwgDgnConverter\ServerDataLoader.obj     DwgDgnConverter
    Error     2     error LNK1120: 1 unresolved externals     P:\code\VizTool\VizPortal\Debug\DwgDgnConverter.exe     1     1     DwgDgnConverter
    Yes, it looks like linking problem,...but for me everything seems set-up.
    - Included header files (from instantclient-sdk-windows.x64-11.2.0.3.0.zip)
    - Included library path from OCCI download (11.2.0.3.0)
    - Added oraocci11d.lib in linker
    Please, what am I doing wrong?
    Millions of thanks for any kind of feedback ;-)

    Have you succeeded? I tried vs2012 and it passed compilation, but gave the run-time error of _crtisvalidheappointer. But the same code runs well with vs2010. I think Oracle needs to publish the new patch for vs2012                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • OCCI - getString() fails in subsequent calls

    while (rs->next())
    cout << << rs->getString(1) ; //name string
    How can I solve it?
    Thanks in advance.

    Hi,
    I once had such problem and I solved after reading following message thread on this same forum. Hope this helps you.
    Re: getString in ocidml.cpp fails
    Have fun ...
    With regards,
    Panneer :-)

  • OCCI Compiling problem

    I am trying to complie a simple OCCI program with the latest Oracle 10g client(with full installation) and gcc 3.2.2-5 (Oracle says OCCI works with gcc 3.2) on a Red Hat 9 box, I got the following error message:
    undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*(void*,unsigned), void* (*)(void*, void*, unsigned),void(*)(void*, void*))'
    undefined reference to`oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)'
    Does anyone know how to solve it? This program works fine with VC++ 6.0 and it is OK to complie OCI program on the same Linux box.
    Thanks in advance!

    Never mind. I got it worked.
    The final commmand I used like this (myprogram is the executable file on linux):
    g++ -o myprogram -L $ORACLE_HOME/lib -L $ORACLE_HOME/rdbms/lib -locci -lclntsh myprogram.cpp
    I got the previous problem by missing "-locci". Right now I get a warning, /u01/app/oracle/product/10.1.0/client_1/lib/libclntsh.so: warning: remap_file_pages is not implemented and will always fail, although it does not affect my programm. Anyone know what does it mean?

  • OCCI setVector() Problem

    Hi
         I have written the following OCCI code to call two procedures
    1. add1_detail(val in number) which is acceptiing an number as input
    2. add_detail2(val in my_type) where my_type is a user defined type (a TABLE of NUMBER type)
    I am trying to call both the procedures from the same OCCI program (one at a time). The code is as follows
    1     #include <iostream>
    2     #include <vector>
    3     #include <occi.h>
    4     using namespace oracle::occi;
    5     using namespace std;
    6     int main()
    7     {
    8          Environment *env = Environment ::createEnvironment();
    9      cout << "Connecting to the database" << endl;
    10      Connection *conn = env->createConnection( "sanju", "sanju","10.116.64.146:1521/ORCL" );
    11      cout << "Environment and Connection created" << endl;
    12          //Statement *stmt = conn->createStatement("begin add1_detail(:1);end;");
    13          //stmt->setInt (1, 8000);
    14          //stmt->executeUpdate();
    15          OCCI_STD_NAMESPACE::vector<int> v1;
    16          v1.push_back(11);
    17          v1.push_back(22);
    18          v1.push_back(33);
    19          v1.push_back(44);
    20          OCCI_STD_NAMESPACE::string schemaName="sanju";
    21          OCCI_STD_NAMESPACE::string typeName="my_type";
    22          Statement *stmt =  conn->createStatement("begin add_detail2(:1);end;");
    23          setVector(stmt, 1, v1, "my_type");
    24          stmt->executeUpdate();
    25          conn->terminateStatement(stmt);
    26          env->terminateConnection(conn);
    27          Environment::terminateEnvironment(env);
    28          cout << "Environment and Connection terminated" << endl;
    29          return 0;
    30     }
    The problem is like this, When I am calling add1_detail() by enabiling lines 12, 13, 14, the program works fine. But when
    I try to call the second procedure by enabiling line 15 to 24 and sisabeling 12, 13, 14, the program is showing exception from line no 8 (ie Environment *env = Environment ::createEnvironment();)
    Strange!
    By using debug mode I came to know that the error is commong from file _ctype.c from the line number 6 below
    1     int (__cdecl isupper) (
    2 int c
    3 )
    4     {
    5     #ifdef _MT
    6     pthreadlocinfo ptloci = _getptd()->ptlocinfo;
    7
    8 if ( ptloci != __ptlocinfo )
    9 ptloci = __updatetlocinfo();
    10
    11 return __isupper_mt(ptloci, c);
    12     #else /* _MT */
    13 return isupper(c);
    14     #endif /* _MT */
    15     }
    can any one please help on this matter
    Regards
    Alok

    Hello,
    I am trying to compile my C++ code (using OCCI) on Sun Solaris 5.9 (SPARC64PLUS) environment.
    We have compiled and tested it on RHEL 5 Linux.
    The Oracle (10g R3) database is on RHEL 5 server while OCCI/C++ application would be running on Sun Solaris 5.9 server.
    Since we have no Oracle installation on the Sun Solaris 5.9 server, there are no OCCI related libraries on this server and hence we are not able to compile our C++ code on Sun Solaris 5.9
    Can someone help me on how/where to download OCCI libraries (compile time as well as run time) for Solaris 5.9 ? I could find only Windows and RHEL versions of OCCI libraries on the Oracle website.
    Also, how stable is OCCI on Solaris 5.9 ?
    Regards,

  • Occi conneciton problem in solaris

    Hai all,
    Any body pls solve my problem
    My sytems details are :
    OS : SunOS mars 5.10 Generic_118833-33 sun4v sparc SUNW,Sun-Fire-T200
    SYSTEM : sparc 64-bit
    gcc version : 3.4.6
    Oracle 10g :10.2.0
    When i am compiling i am getting as :
    g++ db.cpp -I /u01/app/oracle/oracle/product/10.2.0/db_1/rdbms/public/ -L. -libocci10 -lclntsh
    ld: fatal: library -libocci10: not found
    ld: fatal: file /u01/app/oracle/oracle/product/10.2.0/db_1//lib/libclntsh.so: wrong ELF class: ELFCLASS64
    Please sugget

    In SOLARIS - Sun Studio (CC/C Compiler) the 64 bit flag is -xarch=native64
    The above flag if used will compile all your programs in 64bit mode and if not used then all will be in 32bit mode. In g++ compiler , you have to use the similar flag.
    The problem is that one of the external libraries you are linking is already 64bit.

  • OCCI, VS2010 problem

    Hi everyone,
    well after a lot of trouble i still get the following error message: "The procedure jump point "OCILobGetOptions" was not found at DLL "oci.dll" "
    and in german: "Der Prozedureinsprungpunkt "OCILobGetOptions" wurde in der DLL "Oci.dll" nicht gefunden"
    The error occur after i start my aplication.
    i use:
    - 11g Client,
    - occivc10_11202_win32.zip
    - Visual Studio 2010
    - WinXP SP3
    i really hope that someone can help me!

    Thanks for the response...
    well the error occur after i compiled and linked the project and then start the aplication. Here ist the code i hope it will help:
    #include "Employees.h"
    using namespace oracle::occi;
    using namespace std;
    int main (void)
         Employees *pEmployees= new Employees();
         pEmployees->List();
         delete pEmployees;
         cout << "Enter um fortzufahren...";
         cin.get();
         return 0;
    Employees::Employees()
         user = "Test";
         passwd = "xxxx";
         db = "Server1:1521/Ora10";
         env = Environment::createEnvironment(Environment::DEFAULT);
         try
              con = env->createConnection(user, passwd, db);
         }catch (SQLException& ex){
              cout << ex.getMessage();     
              exit(EXIT_FAILURE);
    Employees::~Employees()
         env->terminateConnection(con);
         Environment::terminateEnvironment(env);
    void Employees::List()
         Statement *stmt = NULL;
         ResultSet *rs = NULL;
         string sql = "SELECT * FROM INFO";
         try
              stmt = con->createStatement(sql);
         }catch( SQLException& ex){
              cout << ex.getMessage();
         if (stmt)
              try
                   stmt->setPrefetchRowCount(32);
                   rs = stmt->executeQuery();
              }catch( SQLException& ex){
              cout << ex.getMessage();
              if(rs)
                   cout << "Ausgabe:" <<endl;
                   while (rs->next()){
                        cout << rs->getInt(1) << endl;
                   cout << endl;
                   stmt->closeResultSet(rs);
    }well i will try somethink tomorrow and hope that it will work :D

  • OCCI linking problems on Solaris

    Hi All,
    I'm writing my first occi application on Solaris and am having trouble linking to the Oracle libraries. Below is the code; I'm using Solaris 2.8, gcc 2.95.3.
    ----------------- test.cpp -----------------------------
    include "occi.h"
    #include <stdio.h>
    using namespace oracle::occi;
    int main()
    Environment *env;
    Connection *conn;
    Statement *stmt;
    try
    env = Environment::createEnvironment(Environment::DEFAULT);
    conn = env->createConnection("SCOTT", "TIGER", "");
    catch(SQLException &e)
    // handle exception
    return 0;
    ----------------- Make file --------------------------
    CC= g++
    LDFLAGS= -L$(LIBDIR)
    LIBDIR= $(ORACLE_HOME)/lib
    LIBS= -lclntsh
    OBJS=test.o
    all: test.exe
    test.exe: test.o
    $(CC) -o test.exe $(OBJS) $(CPPFLAGS) $(LDFLAGS) $(LIBS)
    clean:
    rm -f $(OBJS) test.exe
    ------------------ ERRORS ----------------------------
    test.o: In function `main':
    test.o(.text+0x18): undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void *, void *(*)(void *, unsigned int), void *(*)(void *, void *, unsigned int), void (*)(void *, void *))'
    test.o(.text+0x1a4): undefined reference to `oracle::occi::SQLException type_info function'
    test.o(.text+0x1a8): undefined reference to `oracle::occi::SQLException type_info function'
    collect2: ld returned 1 exit status
    ===================================================
    I tried also linking libocci.so, but resulted in even more tedious errors.
    Any suggestions would be greatly appreciated. Thanks!!

    Thanks for your reply. I installed the Sun Forte Compiler 7 and tried again. The errors I got this time are:
    ----------------- ERRORS ---------------------
    Undefined first referenced
    symbol in file
    __builtin_delete test.o
    __length_error(const char*) test.o
    __ls__7ostreamPFR7ostream_R7ostream test.o
    terminate(void) test.o
    createEnvironment__Q36oracle4occi11EnvironmentQ46oracle4occi11Environment4ModePvPFPvUi_PvPFPvPvUi_PvPFPvPv_v test.o
    endl(ostream&) test.o
    cerr test.o
    __ls__7ostreamPCc test.o
    __cp_pop_exception test.o
    __tfQ36oracle4occi12SQLException test.o
    copy__t18string_char_traits1ZcPcPCcUi test.o
    __eh_rtime_match test.o
    __throw test.o
    length__t18string_char_traits1ZcPCc test.o
    __start_cp_handler test.o
    move__t18string_char_traits1ZcPcPCcUi test.o
    __out_of_range(const char*) test.o
    ld: fatal: Symbol referencing errors. No output written to test.exe
    ====================================================
    Do you have any other suggestions? Though Linux sounds good, I have no choice but to develop on Solaris.
    Thanks very much!

Maybe you are looking for

  • Canon 7D2 RAW thumbnails not displaying in Finder

    Does anyone know when Apple will provide an update so that 7D2 RAW files will display correctly as thumbnail images instead of just icons? I do not use iPhoto and I do not wish to upgrade from Mountain Lion.

  • Error message:The operation cannot complete because of an unknown error. [!IMP]

    When I select the image it show these message box, how can i fixed it???

  • Hyperion 9 BQY SmartCut

    If I open my BQY through the SmartCut it opens in HTML always and the code that I have behind the report does not work. How do I get a SmartCut link to open in Interactive Reporting Studio. If I access the BQY through the workspace (which I have my p

  • Check box in smartforms

    How to put check box (secondary window text element )in smart forms. Regards, Kaaviya

  • Upgrading OS on older Macbook.

    Have an older black macbook (bought in 2007).  Running Tiger and processor is 2.16 Ghz Intel Core 2 Duo with 2 GB DDR2 SDRAM.  Because I cannot access my iphone now I need to update O/S.  Would the Snow Leopard work well with my current system.  Do I