From ODBC to OCCI

Hello,
I have an application that uses ODBC and I want to change it into OCCI.
Could you please give me any hints or an example how to realize that.
Thanks a lot and have a nice day.

Thank you for you help Justin. I have converted ODBC versions of calls to OCCI by replacing "{call with "BEGIN and )}" with );END;" Worked for me. However, one of my querries which works in ODBC hangs in OCCI. It is a select statement. I placed it bellow. When I call rset->next(), my app hangs ( I waited more than half an hour for it to respond and gave up ). I checked rset->status before calling next, it returned 1. Any ideas?
Here is the querry:
SELECT symtom_name, p.Create_Date, p.Problem_ID, p.Sentry_ID, p.status,
nvl(se.host_name,'N/A'), decode(p.sensorip,'unknown','Not Reported',null,'Not Reported','null','Not Reported',p.sensorip), nvl(se.short_description,'N/A'), p.sensor_hostname, nvl(CountPTGatewayMessage(p.Problem_ID),0) FROM rep_problemticket p, (SELECT short_description,device_ip,host_name,sentry_id FROM rep_sensor WHERE company_id ='123')se WHERE p.sensorip=se.device_ip(+)
AND p.sentry_id=se.sentry_id(+) AND p.Company_ID = '456' ORDER BY create_date desc
Thanks.

Similar Messages

  • Create a new oracle database from OCI or OCCI client

    Hi,
    How can we create a new oracle database from OCI or OCCI client?
    i am using the oracle 11gR2
    Thanks in Advance,
    Sreekanth Polaka

    Though I have not tried creating a database, try if its doable.
    You can use OCI to perform SYSDBA operations.
    So connect as OCI_SYSDBA and try executing the entire create database command.

  • How to call PL/SQL function from ODBC

    Greetings (and thanks for reading),
    I am using Oracle 9i (9.2.0.4) database, running on SUN [sparc] Solaris 9. I have created the following types:
    create or replace type NAME_VAL_TYP is object
    (NAME   varchar2(30)
    ,VALUE  varchar2(30))
    create or replace type PARMS_VARRAY_TYP is varray(10) of
    NAME_VAL_TYP
    /and the following PL/SQL function:
    function F0 (P_PARAMS  PARMS_VARRAY_TYP) return numberHow do I call this function from ODBC?
    Thanks (in advance),
    Avi.

    Sorry, this is not mapped in the ODBC driver--none of the object types are. The spec doesn't really account for them.

  • Migrating from OCI to OCCI

    Hi everyone,
    I'm currently tasked with finding a way to migrate our code slowly from OCI to OCCI. The idea is the following:
    We have an application that creates an OCI environment and context, etc. and we'd like to reuse that existing connection in a surround C++ program. So essentially, create an OCCI environment from an OCI environment.
    So, I've found a documented way to get an OCI environment from an OCCI environment, however I couldn't find anything about the other way around.
    Is there maybe some undocumented constructor or something along those lines, that would allow to go this route? If there is an expert, who could give me a clear 'NO' to this, it would also be very helpful.
    Thanks for any advice!
    Peter

    Since OCCI is built as a interface over the OCI you can get hold of an OCIEnv from OCCI
    The other way is not possible as OCI does not know anything about OCCI.

  • How to get information from ODBC sources to Forms Builder environment

    Hi,
    Could anyone help me, to get some examples or more information, that how can I get information from ODBC sources to Forms Builder environment. I have a need to read data for example to LOV.

    If you are on Forms 6i you install the Oracle Client Adaptor from the Forms CD. You then have a way of connecting to ODBC datasources.
    To connect to ODBC at the same time as you are connected to Oracle you can use the EXEC_SQL package to create a second connection via odbc and issue select statements against that datasource.

  • Reason to explain these performances of odbc and occi...

    I wrote some simple test programs to compare the performances of odbc and occi accessing Oracle.
    These programs were wrote in C++. The occi and odbc were given under almost the same circumstance.
    The result is: when executing query(simple select) the odbc is fast than occi. When executing insert sentences, the occi is much more fast than odbc does.
    My computer environment: Oracle 10g, Oracle instant cilent, VS 8.0.
    Do they all access oracle through OCI interface? How to explain the result?
    Someone give me some hints , please.

    Hi,
    With the limited info available, I can't offer any specific suggestions that will help here.
    Usually sqlnet tracing is a good thing to check to see if maybe it's round trips causing the discrepency, packet/buffer sizes, query differnces, etc.
    Server side sql tracing is often useful as well to check bind types, query execution, etc.
    Yes, both Oracle's ODBC driver and OCCI are written in OCI, but they have completely different implmentations: array fetching, statement caching, buffer sizes, etc. Simply because they're both written in OCI doesnt mean they share an implmentation.
    Hope it helps,
    Greg

  • ODBC, OCI, OCCI

    Hi,
    Could anyone tell me whether I can access a Oracle Spatial instance through Oracle 9i AS Wireless using ODBC, OCI or OCCI. I want to interrogate the spatial database from a Compaq iPAQ running the familiar distribution of embedded Linux.
    Cheers,
    Sean

    iAS is an application server, which pretty much indicates that you'll be writing Java. ODBC, OCI, and OCCI are C or C++ API's. It's probably possible to set up a system that makes JNI calls in iAS to C or C++ libraries, but that hardly seems like the ideal architecture.
    If you want to use a Java application, JDBC is the Java API for database access. JDBC will certainly allow you to work with the Oracle Spatial datatypes.
    You can also use things like mod_plsql with iAS to do the vast majority of middle tier work in PL/SQL.
    If you want to use OCI or OCCI, you could certainly write a middle tier layer there, throw some ASP pages on top, and expose that through IIS (since you mentioned ODBC as an option, I'm assuming you're a Windows shop).
    The ODBC does not provide a particularly useful way to work with Oracle-specific data types like those in interMedia.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • Need help to generate "where current of" from ODBC

    Hi
    I am trying to develop a small stand-alone program which uses Oracle Drivers.
    I have installed PERL and came up with a code (structure) like below
    But I dont know how to use the current cursor reference with a statement
    This is what I came up with
    use Win32::ODBC;
    my($db) = new Win32::ODBC("dsn=TEST_DSN; uid=TEST; pwd=TEST");
    $db->SetStmtOption(SQL_CURSOR_TYPE,SQL_CURSOR_KEYSET_DRIVEN);
    $db->SetStmtOption(SQL_ROWSET_SIZE,10);
    $db->SetCursorName("abc");
    $cursth = $db->prepare('SELECT * FROM pos_update_table testupdate where val=1 FOR UPDATE');
    $cursth->execute;
    print $db->GetCursorName;
    while ($cursth->fetch) {
    $updsth = $db->prepare("update pos_update_table set val=val+100 WHERE CURRENT OF $cursth->{CursorName}");
    $updsth->execute;
    $db->commit;
    $db->Close();
    Thanks in advance
    PS: The table has one row and the intention is to update the row using where current of clause.
    Message was edited by:
    k.venkat

    Thanks Justin for your reply.
    I am aware of I dont need a cursor for updating single row..but from one of the applications (which uses ORACLE ODBC) i get this ODBC error "no rows updated" if I hit on save button twice (from the application)
    The ODBC trace shows "where current of" clause and in the database (ORACLE 9.2) shows "update tablename set ...where rowid = "
    Now I am trying to test the ODBC and trying to generate the same Statements (with where current of)
    and fyi: PERL/WIN32:ODBC supports where current of coding-style (source: http://www.codeproject.com/books/1578700671.asp ..search for 'where current of')
    The point is I dont want to manually grab the rowid and use it for update..Instead I want the ODBC write its own statement
    Thanks
    Venkat

  • Calling Stored Procedure from ODBC

    I call a stored procedure that contains a reference to a database link through ODBC.
    I get the following errors (LOAD_PDI is the name of the procedure):
    ORA-02041: Client database did not begin a transaction
    ORA-06512: at "LOAD_PDI" line 16
    ORA-06512: at "LOAD_PDI" line 42
    ORA-06512: at line 1
    The procedure works if called from SQLplus and executes a query on a remote database to insert or update tables in the local data base. In the procedure I define two CURSORS to get data from the remote Database.
    Is there anything unsupported using ODBC ?
    Same error messages calling from Visual Basic using ADO. I have installe dthe last versione of OLEDB driver (8.1.6.2).
    I am using Oracle Enterprise 8.1.6 release 2 on Windows NT server 4.0 with service pack 6.
    Thanks for collaboration.
    null

    The only way I'm aware of to turn off autocommit is to issue the ODBC call
    SQLSetConnectAttr( hdbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, SQL_NTS )
    Note that you'll have to issue a SQLEndTran call with SQL_COMMIT or SQL_ROLLBACK to commit or rollback your changes with autocommit off.
    I'm curious as to whether you saw any documentation which indicated that the way to turn off autocommit was to add the registry entry 'autocommit=F'. That's certainly not an option I'm familiar with, so I'd like to ensure that we don't have incorrect documentation laying around.
    The reason you'll see different behavior using ODBC as opposed to SQL*Plus is because the two have different semantics.
    In SQL*Plus, statements that you execute are not committed until you execute an explicit commit statement. This is pretty standard for database interfaces, and is generally necessary if you want to maintain state in a transaction.
    When Microsoft wrote the ODBC specification, they broke with this convention and specified that ODBC would, by default, commit every statement immediately after is suceeds. This may cause problems if your procedure assumes that it is able to maintain state between uncommitted calls.
    For example, in SQL*Plus, if you issue the command "select empno from emp for update", the "for update" clause places a lock on those elements. Subsequent updates generally assume that those locks are still present. If you issue a "commit", however those locks are discarded.
    In ODBC, if you issue the same command without explicitly turning off autocommit, the statement succeeds, taking out the locks, but then is immediately & automatically committed, releasing those locks. If you turn off autocommit, you get the same behavior you saw with SQL*Plus.
    I suspect that the stored procedure LOAD_PDI maintains some state and that the code on lines 16 & 42 are doing some form of update that relies on this state being present.
    Note that, since you don't specify that you are, I'm assuming that you're not using XA or Microsoft's transaction server to do coordinated multi-machine transactions. If you are using one of these, please let me know.
    Justin Cave
    ODBC Development

  • Calling stored java-procedure in Oracle9i Lite from ODBC

    I've got a problem:
    I try to call a stored java-procedure through ODBC. The stored
    java-procedure in Oracle 9i Lite is called successfully from
    server console (MSQL). When I call my stored java-procedure from
    my web-application (ASP) through ODBC connection (ODBC drivers
    are from Oracle 9i Lite set V3.51) the server returns an error
    (Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [POL-
    8000] could not start the Java Virtual Machine),
    however 'select' without java-procedure calls works
    successfully. PATH and CLASSPATH variables are properly set up.
    File jvm.dll is present.
    Can anybody help me?

    Pass String[] as an argument to mainbook():
    create or replace PROCEDURE openpdffile
    AS LANGUAGE JAVA
    NAME 'pdfopenbook.mainbook(java.lang.String[])';Have you posted it on the Database forum?
    Regards,
    Nick

  • Migrate tables and data from ODBC datasource to Oracle 11.2

    Hiya
    I have a database file in Dynamics NAV 5.0 native format - about 200-300 tables totalling maybe 10 GB worth of data.
    My task is to migrate those tables with their data into a schema in our Oracle 11.2 database.
    No tools support the NAV format directly :-) But I have a windows ODBC driver for that format that works.
    The Oracle database runs on Linux and I have no ODBC transparent gateway and no linux ODBC driver that would let me access the NAV datafile directly from within Oracle.
    I tried migration wizard in SQL Developer, but it seems it cannot use a "generic ODBC" datasource (even with JDBC-ODBC bridge), it must be a supported database format?
    Then I have tried trial of product Altova MapForce, but it can't seem to read the schema (table/columns) from the ODBC datasource for some reason.
    I know reading the schema from the ODBC datasource is possible - I have used third party product "Database Browser" that reads the ODBC with no problems.
    And a colleague has read the schema of the ODBC in C# also.
    I am primarily a SQL developer. My colleague said he could write in C# a program that looped over the tables in the ODBC, read the columns, executed "create table" in Oracle, read data from the ODBC, inserted data in Oracle.
    But he is going on vacation right now :-( And I keep thinking that someone else must have written such a migration program ;-)
    I just can't seem to find it by googling? Altova Mapforce was my best bet, but it just seems to have problems with this specific ODBC datasource.
    Any ideas for a migration tool that can accept a generic ODBC datasource and not specifically SQL Server, MySQL, DB2, etc.?
    Thanks for any hints that might help ;-)
    Regards
    Kim Berg Hansen

    Hi Kim,
       The earlier 9i and 10g generic connectivity option - HSODBC - could only run as part of the RDBMS but the 11g DG4ODBC can be installed and run standalone without an RDBMS.  You then connect using database links from Linux using an entry in the RDBMS tnsnames.ora as you have said.
    See these notes depending if Windows is 32-bit or 64-bit -
    How to Configure DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit to Connect to Non-Oracle Databases Post Install (Doc ID 466225.1)
    How to Configure DG4ODBC (Oracle Database Gateway for ODBC) on 64bit Windows Operating Systems to Connect to Non-Oracle Databases Post Install (Doc ID 1266572.1)
    The latest 11.2 version is available from My Oracle Support as -
    Patch 13390677: 11.2.0.4.0 PATCH SET FOR ORACLE DATABASE SERVER
    and for the gateways you only need to download -
    p13390677_112040_WINNT_4of6.zip
    for 32-bit but
    p13390677_112040_MSWIN-x86-64_5of7.zip
    for 64-bit.
    The downloads have everything necessary for a gateway standalone install.
    Regards,
    Mike

  • Populate fields from ODBC

    Im trying to populate through odbc certain fields on the form, [ex. patient_id, firstname, last name, address, etc] which must change when primary/unique field [hence patient_id] is updated. Relationship is dictated by default from db and is picked up by msquery as well. However i cannot find a way to create relationship of all fields to each other and aspecially primary key. Please advise me of how such can be assembled. I need for the form only to grab database fields, and based on primary key fill out portion of the form. [no need to overwrite/write to db] Thanks, your help would be greatly appreciated!!!

    Hi,
    Try this link:
    http://forms.stefcameron.com/2006/10/12/displaying-all-records-from-an-odbc-data-connectio n/
    Hope this will help!!
    Regards--
    Chalukya.

  • Creating two or more procedures from ODBC

    Hi.
    I'm trying to create several standalone procedures in an Oracle 8.1.7 server, using ODBC pass-thru.
    I'm trying to create these procedures:
    CREATE OR REPLACE PROCEDURE EMSetContext(compid CHAR)
    AS BEGIN
    dbms_session.set_context('EMCTX','compid',RPAD(compid,5));
    END;
    CREATE OR REPLACE FUNCTION EMGetContext
    RETURN VARCHAR
    AS BEGIN
    RETURN SYS_CONTEXT('EMCTX','compid');
    END;
    CREATE OR REPLACE PROCEDURE EMPutInContext(p_table CHAR, p_schema CHAR)
    AS BEGIN
    DBMS_RLS.ADD_POLICY(p_schema,p_table,'EMCTX_ACF',p_schema,'EMCTX_ACF','SELECT,UPDATE,INSERT,DELETE');
    END;
    GO
    CREATE OR REPLACE FUNCTION EMCTX_ACF(p_schema varchar2, p_object varchar2)
    RETURN varchar2
    AS
    cCompID CHAR(5) := SYS_CONTEXT('EMCTX','compid');
    BEGIN
    IF cCompID <> 'DBA' THEN
    RETURN 'compid=''' || cCompID || '''';
    ELSE
    RETURN '';
    END IF;
    END;
    GO
    I already tests all these procedures in PL/SQL and they are sintaxticaly correct. I send to the Oracle server one procedure at a time, but just the first one is created without errors, no matter which of then I send first.
    Is there any special sign or command I'm missing after each CREATE OR REPLACE statement?
    TIA
    Victor Espina

    Ok, I did query the user_errors table. Then, I open a new connection to Oracle and sucessfuly sent this command via ODBC SPT:
    CREATE OR REPLACE PROCEDURE EMSetContext(compid CHAR)
    AS BEGIN
    dbms_session.set_context('EMCTX','compid',RPAD(compid,5));
    END;
    Then, I sent this command:
    SELECT * FROM user_errors;
    and the result was:
    NAME: EMSETCONTEXT
    TYPE: PROCEDURE
    SEQUENCE: 1.0
    LINE: 1.0
    POSITION: 37.0
    TEXT:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    ; is with authid deterministic parallel_enable as
    Then, I tried to run the same command using SQL Plus and it worked just fine.
    Any ideas?
    Victor Espina

  • Set location from ODBC to qry

    Hi,
    The report I want to change is based on ODBC tables. I want to change the report based on a qeury, and cannot find a way. Do I have to create from scratch?
    Any advise will be appreciated.

    Explain what a query is? Are you using a command object? If so then currently your only option is to re-build the report. CR has no way of mapping from or too a Command object due to the vast variations in SQL syntax that can be used.
    Thank you
    Don
    Moved to Database Connectivity Forum
    Edited by: Don Williams on Oct 22, 2009 2:27 PM

  • Issue with GetSchema("Columns") of Oracle driver from ODBC DSN

    Hi,
    I have installed Oracle Express Edition and have created a windows System DSN for Oracle driver 'Oracle in XE'. From my .Net application using ODBC connection string, I am trying get the schema of columns of a particular table in Oracle DB and the sample code is given below.
    dtSchema = odbcConn.GetSchema("Columns", new string[4] { odbcConn.Database, null, strTableName, null });
    Does Oracle driver accept the restrictions to be passes as paramenter to GetSchema() method?
    Please help me ASAP.
    Regards,
    Sasi Rekha.

    Even If create table manually in the Oracle Database using varchar2 but still when i copy the data query mysql database it shows spaces in the value column.

Maybe you are looking for

  • How to insert this css style to table

    Hi, I'm a beginner in web design. I wanted to use a custom separator for my navigation bar. I searched and found this separator: http://front-back.com/pure-css-3-fancy-separator I'm interrested in the vertical-left one. I compiled the scss code to cs

  • Adding alert activity in OSB message flow urgent

    hi, i added an alert activity in my OSB proj message flow to monitor the process . after deploying the proj in console, i gave inputs. but i am not able to see the alert in operations>dashboard>pipeline alerts . no alert has been written in dashboard

  • Selection Criteria in Infopackage

    Hello,   Is there a way to use a single infopackage by passing different selection conditions thru' abap routine, for delta init.  We require this as we have to extract data based on the logged-in user.   Any help is highly appreciated. Thank you ver

  • Datapump impdp related issues, please do suggest

    I am running impdp importon oracle 10g and got following errors at end of the import , Please do suggest how to solve this. ORA-39083: Object type TABLE_STATISTICS failed to create with error: ORA-06502: PL/SQL: numeric or value error ORA-06512: at "

  • Having Trouble Downloading Lion

    When I hit the purchase button a Lion icon shoots down into the dock and just sits there saying "OSX Lion -Waiting" am I doing somethng wrong? Or is the whole world trying to download this at the same time? I let it sit al night yestrday with the sam