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,

Similar Messages

  • 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!

  • 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 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 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 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!

  • OCI works but OCCI doesn´t work

    Hi,
    I am developing a component of a project to execute a pool of inserts to a DB.
    I installed the instant client 10g, headers and the occi for linux.
    When I execute the example of oci (cdemo81) it runs OK but when I execute the occi example occidml it crash and aborted.
    Do you have a suggestion why the OCCI doesn't´ work?
    Thanks,
    Mikel

    I try to execute the example 10g Release 1
    and I´ve got this error :(
    link.once ? Do you know what is happening?
    g++ -DHAVE_CONFIG_H -I. -I. -I.. -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -O0 -g3 -Wall -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -c -o main.o `test -f 'main.cpp' || echo './'`main.cpp
    /bin/sh ../libtool silent mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -O0 -g3 -Wall -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -o oci main.o
    main.o(.gnu.linkonce.t._ZN8occicollC1ESsSsSs+0x44): In function `occicoll::occicoll(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
    /usr/include/c++/3.2.3/bits/stl_algo.h:298: undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'
    main.o(.gnu.linkonce.t._ZN8occicollD1Ev+0x2e): In function `occicoll::~occicoll()':
    /home/vientoloco/nuevatel/oci/kdevelop/oci/oci/main.cpp:100: undefined reference to `oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)'
    main.o(.gnu.linkonce.t._ZN8occicoll9insertRowEv+0x24f): In function `occicoll::insertRow()':
    /home/vientoloco/nuevatel/oci/kdevelop/oci/oci/main.cpp:180: undefined reference to `oracle::occi::setVector(oracle::occi::Statement*, unsigned int, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    main.o(.gnu.linkonce.t._ZN8occicoll14displayAllRowsEv+0x1b9): In function `__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > std::find<__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::random_access_iterator_tag)':
    /usr/include/c++/3.2.3/bits/stl_vector.h:916: undefined reference to `oracle::occi::getVector(oracle::occi::ResultSet*, unsigned int, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)'
    main.o(.gnu.linkonce.t._ZN8occicoll9deleteRowEiSs+0x178):/usr/include/c++/3.2.3/bits/stl_vector.h:906: undefined reference to `oracle::occi::getVector(oracle::occi::ResultSet*, unsigned int, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)'

  • Environment OBJECT vs THREADED_MUTEXED

    Hello,
    I am working on this project that required multi-threads environment, currently I am using occi on 10G oracle db.
    When creating the occi environment I have to use THREADED_MUTEXED. This worked fine. Now I have to extend my program to include bind vector by using occi::setVector. In order to make setVector to work I need to create occi environment as OBJECT instead of THREADED_MUTEXED otherwise I will get the exception complaining about the object is not being created.
    This creates a huge problem between creating OBJECT and THREADED_MUTEXED.
    What do I need to do?
    Thank in advance
    Tim

    prajithparan wrote:
    There is a workaround for this ...,
    In $ORACLE_HOME/rdbms/public/occiControl.h <A class=bodylinkwhite href="http://www.software-to-convert.com/mpeg4-conversion-software/mpeg4-to-h263-software.html"><FONT face=tahoma,verdana,sans-serif color=#000 size=1>file</FONT></A>The modes are defined as shown below
    enum Mode
    DEFAULT = OCI_DEFAULT,
    OBJECT = OCI_OBJECT,
    SHARED = OCI_SHARED,
    NO_USERCALLBACKS = OCI_NO_UCB,
    THREADED_MUTEXED = OCI_THREADED,
    THREADED_UNMUTEXED = OCI_THREADED | OCI_ENV_NO_MUTEX,
    EVENTS = OCI_EVENTS,
    <B>OBJECT_THREADED = OCI_OBJECT|THREADED_MUTEXED</B>
    USE_LDAP = OCI_USE_LDAP
    However , I am NOT sure how far the Oracle Supports this.It is exactly what I need, Thanks for your analysis!

  • I can't use REF to Database Object

    i use the following code to retrieve the Oracle Spatial SDO_GEOMETRY Object references:
    string sel_geom = "SELECT REF(geom)
    FROM addr_tab states";
    ResultSet *rs = stmt->executeQuery(sel_geom);
    rs->next();
    Ref<SDOGeometry> geom_ref = rs->getRef(1);
    i can retireve the GEOMETRY objects by useing:
    string sel_geom = "SELECT geom
    FROM addr_tab states";
    ResultSet *rs = stmt->executeQuery(sel_geom);
    rs->next();
    SDOGeometry* geom = rs->getObject(1);
    but when i use "delete geom" to free the object, its memories can not be free completely.
    who can tell me what can i do?
    thank you very much!
    Bin

    Yes, I use "stmt->closeResultSet(rs)" and "conn->terminateStatement(stmt)" to do that.
    The classes.cpp like:
    // generated method implementations for the SDO_GEOMETRY object type.
    oracle::occi::Number SDOGeometry::getSdo_gtype() const
    return SDO_GTYPE;
    void SDOGeometry::setSdo_gtype(const oracle::occi::Number &value)
    SDO_GTYPE = value;
    oracle::occi::Number SDOGeometry::getSdo_srid() const
    return SDO_SRID;
    void SDOGeometry::setSdo_srid(const oracle::occi::Number &value)
    SDO_SRID = value;
    SDOPointType * SDOGeometry::getSdo_point() const
    return SDO_POINT;
    void SDOGeometry::setSdo_point(SDOPointType * value)
    SDO_POINT = value;
    OCCI_STD_NAMESPACE::vector< oracle::occi::Number >& SDOGeometry::getSdo_elem_info()
    return SDO_ELEM_INFO;
    const OCCI_STD_NAMESPACE::vector< oracle::occi::Number >& SDOGeometry::getSdo_elem_info() const
    return SDO_ELEM_INFO;
    void SDOGeometry::setSdo_elem_info(const OCCI_STD_NAMESPACE::vector< oracle::occi::Number > &value)
    SDO_ELEM_INFO = value;
    OCCI_STD_NAMESPACE::vector< oracle::occi::Number >& SDOGeometry::getSdo_ordinates()
    return SDO_ORDINATES;
    const OCCI_STD_NAMESPACE::vector< oracle::occi::Number >& SDOGeometry::getSdo_ordinates() const
    return SDO_ORDINATES;
    void SDOGeometry::setSdo_ordinates(const OCCI_STD_NAMESPACE::vector< oracle::occi::Number > &value)
    SDO_ORDINATES = value;
    void *SDOGeometry::operator new(size_t size)
    return oracle::occi::PObject::operator new(size);
    void SDOGeometry::operator new(size_t size, const oracle::occi::Connection sess,
    const OCCI_STD_NAMESPACE::string& table)
    return oracle::occi::PObject::operator new(size, sess, table,
    (char *) "MDSYS.SDO_GEOMETRY");
    void SDOGeometry::operator new(size_t size, void ctxOCCI_)
    return oracle::occi::PObject::operator new(size, ctxOCCI_);
    void *SDOGeometry::operator new(size_t size,
    const oracle::occi::Connection *sess,
    const OCCI_STD_NAMESPACE::string &tableName,
    const OCCI_STD_NAMESPACE::string &typeName,
    const OCCI_STD_NAMESPACE::string &tableSchema,
    const OCCI_STD_NAMESPACE::string &typeSchema)
    return oracle::occi::PObject::operator new(size, sess, tableName,
    typeName, tableSchema, typeSchema);
    OCCI_STD_NAMESPACE::string SDOGeometry::getSQLTypeName() const
    return OCCI_STD_NAMESPACE::string("MDSYS.SDO_GEOMETRY");
    void SDOGeometry::getSQLTypeName(oracle::occi::Environment env, void *schemaName,
    unsigned int &schemaNameLen, void **typeName, unsigned int &typeNameLen) const
    PObject::getSQLTypeName(env, &SDOGeometry::readSQL, schemaName,
    schemaNameLen, typeName, typeNameLen);
    SDOGeometry::SDOGeometry()
    SDO_POINT = (SDOPointType *) 0;
    void SDOGeometry::readSQL(void ctxOCCI_)
    SDOGeometry *objOCCI_ = new(ctxOCCI_) SDOGeometry(ctxOCCI_);
    oracle::occi::AnyData streamOCCI_(ctxOCCI_);
    try
    if (streamOCCI_.isNull())
    objOCCI_->setNull();
    else
    objOCCI_->readSQL(streamOCCI_);
    catch (oracle::occi::SQLException& excep)
    delete objOCCI_;
    excep.setErrorCtx(ctxOCCI_);
    return (void *)NULL;
    return (void *)objOCCI_;
    void SDOGeometry::readSQL(oracle::occi::AnyData& streamOCCI_)
    SDO_GTYPE = streamOCCI_.getNumber();
    SDO_SRID = streamOCCI_.getNumber();
    SDO_POINT = (SDOPointType *) streamOCCI_.getObject(&SDOPointType::readSQL);
    oracle::occi::getVector(streamOCCI_, SDO_ELEM_INFO);
    oracle::occi::getVector(streamOCCI_, SDO_ORDINATES);
    void SDOGeometry::writeSQL(void objectOCCI_, void ctxOCCI_)
    SDOGeometry objOCCI_ = (SDOGeometry ) objectOCCI_;
    oracle::occi::AnyData streamOCCI_(ctxOCCI_);
    try
    if (objOCCI_->isNull())
    streamOCCI_.setNull();
    else
    objOCCI_->writeSQL(streamOCCI_);
    catch (oracle::occi::SQLException& excep)
    excep.setErrorCtx(ctxOCCI_);
    return;
    void SDOGeometry::writeSQL(oracle::occi::AnyData& streamOCCI_)
    streamOCCI_.setNumber(SDO_GTYPE);
    streamOCCI_.setNumber(SDO_SRID);
    streamOCCI_.setObject(SDO_POINT);
    oracle::occi::setVector(streamOCCI_, SDO_ELEM_INFO);
    oracle::occi::setVector(streamOCCI_, SDO_ORDINATES);
    SDOGeometry::~SDOGeometry()
    // I added the tow line codes but they can't free the mem
    // and the performance is lower.
    // SDO_ELEM_INFO.clear();
    // SDO_ORDINATES.clear();
    delete SDO_POINT;
    I think it should be free the mem by delete the SDOGeometry object. I can free the POINT_TYPE SDOGeometry (that the SDO_ELEM_INFO and SDO_ORDINATES are both empty) completely. So I think the SDO_ELEM_INFO and SDO_ORDINATES arrays can't be freed by SDOGeometry class. As I said, I can free the "new SDOGeometry()" object by "delete operator".
    Why?
    thanks a lot.

  • Problem with setVector

    Hi all,
    I am facing the following problem while trying for a bulk insertion using occi.
    I am running the VC.NET 2003.
    I am using OCCI successfully.
    But for the following set of codes I am facing problem
    I have created a stored procedure which will take two set of arrays and that is correct also.
    now I am getting the problem in setVector because at this point it is throwing exception.
    my C++ code is
    vector<int> strArrTitle;
         strArrTitle.push_back(10);
         strArrTitle.push_back(20);
         strArrTitle.push_back(30);
         vector<int> strArrContent;
         strArrContent.push_back(100);
         strArrContent.push_back(200);
         strArrContent.push_back(300);
         stmt = conn->createStatement("BEGIN Sample_proc(:1, :2); END;");
         stmt->setMaxIterations(strArrContent.size());
         stmt->setMaxParamSize(1,4);
         stmt->setMaxParamSize(2,4);
         setVector(stmt,1,strArrBook,"VARCHAR2_TABLE");
         setVector(stmt,2,strArrAuthor,"VARCHAR2_TABLE");
         stmt->executeUpdate();
    It is throwing exception at the point of setVector all things are okay as per me.
    Please help me on this
    thanks in advace

    one correction
         setVector(stmt,1,strArrTitle,"VARCHAR2_TABLE");
         setVector(stmt,2,strArrContent,"VARCHAR2_TABLE");
    and they take only integers.
    Thanks

Maybe you are looking for

  • Give two different speeds (FPS) in one file

    Hey Maybe you can help me on getting this ready: I want to animate two different animations in one file, each with different speeds. for example a menu loading at 12 fps and a bird suddently flying away at 2 fps. Thx for helping! Jo

  • Fixed due date for billing created in a period

    Hi We want the new payment tem that should work in the following way Billing date from 01.01.2008 to 31.03.2008 due date should be 20.04.2008 Billing date from 01.04.2008 to 30.06.2008 due date should be 20.07.2008 Please note that the billing period

  • Network

    I have a wireless HP printer and I am hooked up to the network set up by ATT but the printer is not responding. What do I do?

  • Billing Plan / Sales Output tax to be deducted at final invoice

    Hello Folks, The scenario is related to construction industry where client billing is triggered via milestone/billing plan. the scenario example is lets say the price is 100USD. After applying 16% tax, the net value will be 116USD. Now, there are tot

  • Enforce to send the messages pending, after the Time To Deliver is changed

    JMS Queue is being used to send data from our database to the headquarters’ database.           Our organization considers using "Time To Deliver Override" during the scheduled downtime of the headquarters’ database. For example, when our admin i