Use OCCI on Oracle 8.0.5 environment

How can i use and install the OCCI on Oracle 8.0.5

OCCI is introduced in 9i. You need to install 9i to get occi libraries. You can connect from a 9i occi program to an 8i database, but all the features may not work.

Similar Messages

  • Using OCCI with Oracle XA Library

    Is it possible to use OCCI with Oracle XA Library?
    the XA function xaoSvcCtx() can returns the OCI service handle
    for a given XA connection. but how to convert it to the OCCI
    Connection class?
    any comments would appreciate
    Ray

    Hi Ravi,
    We are now building CORBA application with C++. some programs
    manage transaction through Transaction service(a TM of X/OPEN
    DTP architecture), these programs must use XA Library.
    OCCI is a wonderful tool for C++ programer,with OCCI building
    a persistent layer over ORACLE is very simple.
    But if OCCI not work with XA we have no choice but PRO*C or
    OCI ,which's actually C style tool and hard to use especially
    in object mode.
    So we hope OCCI can provide this feature in next release. and
    I beleive This feature is necessary,It's very common using a
    transaction monitor such as ORACLE Application Server .
    regards,
    Ray

  • Oracle 9i OCCI and Oracle 8i Database

    Hi All
    I need to use OCCI on my client side. My database server runs on Oracle 8.1.6.0.0 . Is it possible to use OCCI (ie Oracle 9i) as mentioned?
    Prompt reply will be highly appreciated.
    Thank you
    Ronak Chokshi

    I have not seen 9i OCCI yet however, if Oracle's upgrades/new versions are consistent from 7.1 onwards, what you need to worry is to check only the SQL*NET setup, if you are using database server installed on different platform.(either via odbc or oracle's own ole (windows client)). If database is also on the same system, things would be very simple. SQL*NET can be tested using standard sql*plus executed from client side. In case of ODBC setup, odbc has its own test utility by which database can be queried. OTN site has detailed documentation on SQL*NET set up. Hope this helps??

  • Calling Oracle function and Procedure using OCCI with in C++ code

    Could any body send me the sample code to create and execute Oracle function and Procedure using OCCI concept in C++?.
    Edited by: 788634 on Aug 16, 2010 4:09 AM

    Hi Vishnu,
    Yes, sure, you can create a PL/SQL procedure, function, package, package body, etc. from within an OCCI application. I would say that, generally, this is not the sort of activity a typical client application would perform unless there is some initialization/installation processes that need to happen. In any case, here is a simple demo showing how to create a stand alone procedure (in a real application I would use a package and body) that returns a ref cursor. The ref cursor is just a simple select of two columns in the hr.countries sample table. Of course, there is no error handling, object orientation, etc. in this demo - I wanted to keep the code as short and as simple as possible to illustrate the concept.
    Regards,
    Mark
    #include <occi.h>
    #include <iostream>
    using namespace std;
    using namespace oracle::occi;
    int main(void)
      // occi variables
      Environment *env;
      Connection  *con;
      Statement   *stmt;
      ResultSet   *rs;
      // database connection information
      string user = "hr";
      string passwd = "hr";
      string db = "orademo";
      // sql to create the procedure which returns a ref cursor as out parameter
      // should be run as hr sample user or in a schema that has select privilege
      // on the hr.countries table and a synonym (countries) that points to the
      // hr.countries table
      string sqlCreate =
        "create or replace procedure get_countries(p_rc out sys_refcursor) as "
        "begin"
        " open p_rc for"
        " select country_id, country_name from countries order by country_name; "
        "end;";
      // pl/sql anonymous block to call the procedure
      string sqlCall = "begin get_countries(:1); end;";
      // create a default environment for this demo
      env = Environment::createEnvironment(Environment::DEFAULT);
      cout << endl;
      // open the connection to the database
      con = env->createConnection(user, passwd, db);
      // display database version
      cout << con->getServerVersion() << endl << endl;
      // create statement object for creating procedure
      stmt = con->createStatement(sqlCreate);
      // create the procedure
      stmt->executeUpdate();
      // terminate the statement object
      con->terminateStatement(stmt);
      // now create new statement object to call procedure
      stmt = con->createStatement(sqlCall);
      // need to register the ref cursor output parameter
      stmt->registerOutParam(1, OCCICURSOR);
      // call the procedure through the anonymous block
      stmt->executeUpdate();
      // get the ref cursor as an occi resultset
      rs = stmt->getCursor(1);
      // loop through the result set
      // and write the values to the console
      while (rs->next())
        cout << rs->getString(1) << ": " << rs->getString(2) << endl;
      // close the result set after looping
      stmt->closeResultSet(rs);
      // terminate the statement object
      con->terminateStatement(stmt);
      // terminate the connection to the database
      env->terminateConnection(con);
      // terminate the environment
      Environment::terminateEnvironment(env);
      // use this as a prompt to keep the console window from
      // closing when run interactively from the IDE
      cout << endl << "ENTER to continue...";
      cin.get();
      return 0;
    }

  • How to pass array of Object in A Procedure using OCCI.......

    I m also trying for How to pass Object to a procedureb using OCCI...
    Steps....
    1. I created A type.....
    2. Then I created a VARRAY using that Type.
    3.After that I have written An Procedure with object as a parameter..
    now using OCCI how do u bind the parameter with this . plz note that using OTT
    i have already created the class representation of above object type i.e class
    four Files Created 1> demo.h 2>registermapping.h
    3> demo.cpp 2>registermapping.cpp
    After I want to Pass the Values in A Vector...
    vctor<full_name *> vect;
    stmt=con->createStatement("BEGIN Add_Object(:1); END;");
    full_name *name1 = new full_name; //Giving the Error here Given below....
    name1->
    name1->
    Through name1 Which Function I will call in which I will Pass a String....
    like
    name1->readSQL("Sanjay"); Or I have to add a function......
    vect.push_back(name1);
    setVector(stmt,1,vect,"FULL_NAME");
    error C2259: 'FullName' : cannot instantiate abstract class
    can u plz suggest me Why this Error is Giving......?
    How to pass the data?
    setFirst_name() and setLast_name() this two function I will add in Demo.cpp which one created automativcally by Using OTT command.....or other way plz tell me Boss ....
    Can u lz Suggest me ASAP....

    hi Nishant ,
    What u have done Now I mm trying ....
    can u Plz Suggest me......
    How to pass and Array of Object in Procedure using OCCI... Doing....
    90% finished Two Error's Are Coming...
    1> If I create the Class then Data Not Inserting table......
    2> If I will create the Class through OTT command.......
    then U can't Instantiate Object It is DIsplying ,this is Abstract Class(PObject)...
    Beco'z the below Method is Not adding Automatically by OTT command which is Pure Virtual Function.....
    But I added this Function Still SAme Error Giving..
    getSQLTypeName(oracle::occi::Environment env, void *schName,
    unsigned int &schNameLen, void **typeName,
         unsigned int &typeNameLen) const
    Plz Suggest me....
    regard's
    sanjay

  • How to use OCCI to develop with vc++2008(vs2008)

    I know, there is two way to use OCCI.one is using instant client,another is using oracle database/client;(*actually,i'm not sure that is right)*
    I install oracle client(10.2.0.1) completely in my computer.
    I make a simple program to test, when i build the program with Debug builder,i got a error:ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255. But when i build the program with Release builder,it works.
    so,is there anyone can help me solve this problem?

    I suspect that you will need to install Oracle 11.2 or 11.1 instant client to get it working with Visual Studio 2008. I cant find the Oracle web page that confirms this though. Note that the 11g client is fully supported for connecting to Oracle 10g databases. Here we use OCCI the 11.2 instant client with VS2008
    See this thread for people who had similar problems in earlier times
    Re: Fail when invoking Environment::createEnvironment(..) in Visual Studio
    This page you might also find handy
    http://oradim.blogspot.de/2009/07/getting-started-with-occi-windows.html
    Good luck

  • Using Tuxedo with Oracle Real Application Clusters (RAC)

    Hi all ,
    Our present Producation environment is Tuxedo8.0 with Oracle 9i as database .
    We are planning to implement oracle RAC .
    Can any one tell us , with the current tuxedo version which is 8.0 ,can we for RAC Or we need to upgrade Tuxedo to 9.1 for RAC Implementation?
    If anyone has Implemented Tuxedo and Oracle with RAC successfully
    Pls share your experience.
    Thanks In Adavance
    Nadeer .

    Subbu,
    As I mentioned earlier in this thread, support for Oracle RAC has been
    implemented in Tuxedo 9.1 and in the Tuxedo 8.1 and Tuxedo 9.0 rolling patch
    streams. There are no plans to backport this feature to Tuxedo 8.0. If you
    plan to use RAC transactionally and if it is possible for multiple services
    that could be located on different RAC instances to be accessed in a single
    transaction (which will be true for most applications), then you should
    upgrade to a version of Tuxedo with support for Oracle RAC. The
    documentation at http://e-docs.bea.com/tuxedo/tux91/ads/adorac.htm#248431
    gives an overview of RAC support in Tuxedo.
    Ed
    <Subramonian Arumugom> wrote in message news:[email protected]..
    Hello Nadeer, Hello Ed,
    Has the implementation of Tuxedo8.0 with Oracle RAC was completed
    successfully ?.
    If it is done , I have few doubts. Could you please help me ?.
    1) I hope your Tuxedo middleware connects to the oracle Database using
    Oracle XA resource manager and the TMS server built using buildtms with
    oracle as RM .As per the mail from Ed, migration of Tuxedo9.1 should be done
    before moving to Oracle RAC.
    Also from BEA documentation, Oracle RAC support was given as new feature in
    Tuxedo9.1.
    Our Application uses Oracle RM to connect to Oracle DB[ Oracle 10g] from
    Tuxedo8.0. So do we need to upgrade to Tuxedo9.1. for using Oracle RAC ?.
    Thanks for your help
    Best Regards
    Subbu
    #9880278452
    Edited by subramonian.a at 04/16/2007 12:15 AM
    Edited by subramonian.a at 04/16/2007 12:19 AM
    Edited by subramonian.a at 04/16/2007 1:37 AM
    Edited by subramonian.a at 04/16/2007 8:20 AM

  • Shutdown Oracle Database in MSCS Environment

    Dear All,
    We are facing problem regarding shutdown the oracle database in Cluster Environment. We have installed SAP HA on windows 2003 server and backend database is Oracle.
    In order to configure the dataguard we have to create the control file from Primary Database for this purpose we have to shutdown and then startup the database in mount state.
    But whenever i shutdown the database from SQL prompt by "shutdown immediate" command and see the status of
    database it always remains in open state.
    I have tried the following options as well but no success:-
    Stop all the instances of SAP and then shutdown the database.
    Shutdown the second node and then shutdown the database.
    Brought offline the ORACLE<SID> group and then shutdown the database.
    Kind Regards

    Hi,
    ORA-12560: TNS:protocol adapter error"
    The above error message comes if Oracle Listener service is not running. Start Oracle TNS Listener service, if it is not running.
    You can create control file while your Primary Database is ONLINE. Use the below mentioned command to create standby control file and use it for recovery at Standby database.
    ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/path/to/controlfile.ctl';
    If you want to Start/Stop SAP/ORACLE in MCSC environment then refer the steps mentioned in these threads, [thread1|Re: how to start/stop a  MSCS clustered SAP system?; and [thread2|Stop sap and oracle on MSCS;.
    Regards,
    Bhavik G. Shroff

  • Oracle Installation for Production Environment.

    Hi All,
    We need to install Oracle in our production environment.
    But since there is no DBA in our project, we need to do it by ourself.
    I was just wondering what all steps and cautions I need to take to install it.
    I was told just double click on Setup.exe :-) and that would suffice.
    I am pretty sure its not that easy, atleast for a production environment.
    We might need to set some params, may be.
    We are at present using Oracle 10g Rel 1.
    Any help/suggestion would be highly appreciated.
    Thanks in Advance,
    Tanuja

    Well, it does more complicate than a double click of setup.exe, especially for a production database.
    It's not only about the installation, also think about how do you want to create your database, the storage configuration, database configuration, and backup/recover strategy etc.
    For installation, make sure you follow Oracle installation guide,
    http://download.oracle.com/docs/html/B10130_02/toc.htm
    And there are many other document here
    http://www.oracle.com/pls/db10g/portal.portal_demo3?selected=1

  • Which version of OCCI for Oracle XE 10.2?

    Hi,
    I have Oracle XE, Linux version 10.2.0.1 installed. I want to connect my C++ application running on the same machine as the database.
    I've seen lots of dire warnings about the importance of making sure that the right versions are installed, but after trawling through the (frankly confusing) documentation I can't for the life of me work out which version of the OCCI I'm supposed to use to connect to this version of the database. Can somebody please tell me?
    Also, as I want to run this application on the same machine as the database, can I use some of the libraries that are installed with Oracle 10g, rather than having to install them separately?
    Thanks,
    L.

    Hi,
    The key parts where the version is truly important when using OCCI are:
    - the compiler (and runtime libraries)
    - the OCCI libraries
    - the Oracle Client version
    Under Linux the OCCI version 10.2 libraries are compatible with gcc (g++) 3.4.3 through 4.1.x versions so you should be OK with that part.
    When using Express Edition on Linux and having everything on the same machine you automatically have a "match" between the Oracle Client and OCCI libraries (since they are all under the one and only Oracle Home).
    On my Express Edition test machine I have the following version of gcc and I have not had any issues (so far!) with OCCI and the database installed "as is":
    [oracle@oel02 ~]$ g++ --version
    g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3.1)
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Not sure if that helps, but possibly...
    Regards,
    Mark

  • How to use OCCI?

    Hi.
    I had just install Oracle 10g. According to OCCI documentation, OCCI is installed as part of that installation.
    So, what else must I do before I could compile some C++ source code which use OCCI?
    I susspect there are needed some links (I use Linux) to OCCI libraries and header files. Am I right?
    My C++ source code is in /home/oracle/c directory and my ORACLE_HOME is /u01/oracle/products/10.2.0/db/
    Please help.

    Ok. I just know, how to link.
    But now when I type (incs and libs are symbolic links to oracle directories with occi.h and libocci.so files):
    g++ prod.cpp -o prod -Iincs -Llibs -locciI receive this:
    libs/libocci.so: undefined reference to `OCINlsCharSetNameToId'
    libs/libocci.so: undefined reference to `OCIAnyDataAttrGet'
    libs/libocci.so: undefined reference to `OCIRefIsNull'
    libs/libocci.so: undefined reference to `OCIRefIsEqual'
    libs/libocci.so: undefined reference to `OCIAQDeq'
    libs/libocci.so: undefined reference to `LdiDateDateConvert'
    libs/libocci.so: undefined reference to `OCIThreadProcessInit'
    libs/libocci.so: undefined reference to `lxuCvtToCtx'
    libs/libocci.so: undefined reference to `OCIThreadMutexDestroy'
    libs/libocci.so: undefined reference to `OCIStringAssignText'
    libs/libocci.so: undefined reference to `lxlinit'
    collect2: ld returned 1 exit statusThat else should I do to fix this?

  • Possible to use ServiceCenter's Oracle database for Content Management?

    Hi,
    I have a quick question, and I would really appreciate if any of you have a quick answer for me.
    My company is sourcing for a Content Management option as a complement to the object information that can be stored in ServiceCenter's CMDB. We are working towards a complete information storage solution, where the CMDB is the obvious master for all object information.
    Our ServiceCenter/CMDB solution is run on an Oracle database. We have an interest in possibly using an Oracle Content Management solution on top of the existing Oracle database.
    A question was raised if the Content Management solution can use ServiceCenter's Oracle database for storing documents, ie act as a Content Management database?
    The documents need to be fully searchable from Oracle's Content Management product. The solution should support storage of a large amount of data and documents and be scalable. It is critical that this in no way lower ServiceCenter's performance.
    Please bear in mind that I'm not a technician, but involved in the portal/Content Management aspect of the project. I'm also responsible for the user environment of our ServiceCenter-implementation.
    Best regards
    Leila Blomqvist
    EDB Business Partner Sweden AB

    Hi Harsha,
    Are you going to use the same ERP server for Content server as well? Are you planning to store the documents of this ECC system to the content server only?
    If yes, what is the use of that, Anyways all the documents will be stored on this server only for this ECC system. Please go through the link given by Mr Saxena above, that will give you a clear picture of how the content server works.
    You can install content server with Max DB although you already have oracle installed on your linux server.
    I would suggest you to check the stuff about content server and get your concepts cleared up before going ahead. if you are not clear, you may end up crashing your existing ERP system as well.
    AC

  • Using KeyFilter Java Bean in Client Server Environment - Mr. Grover hope u r here !

    Hello,
    I will be grateful if some one can tell me how to use Keyfilter
    java bean in Forms 6.0 client server environment.
    Our requirement is to restrict entry in text field to just upper
    case characters at key punch rather than after navigating out of
    field.
    Thanx in advance.

    Are you using
    http://otn.oracle.com/sample_code/products/forms/content.html#jbp
    jc
    Since the readme file shows exactly what you have to do.
    Basically you set the implementation class for a text field to
    point to this class and make sure this class is accessable.
    Regards
    Grant Ronald
    Forms Product Management

  • Error while using P2V in Oracle VM 2.2 version

    Error while using P2V in Oracle VM 2.2 version
    I tried using this option by using the steps given on one link but it didnt worked...
    Error:
    code 404, message No permission to list directory.
    I ve tried giving full permissions on for /OVS on Server but invain.
    Can U pls help me...
    Thanks in advance.
    Edited by: user10310678 on Sep 16, 2009 3:32 AM

    user10310678 wrote:
    I am using beta version. Oracle VM Manager 2.2.0If you have a beta version of 2.2, then you should be an Oracle employee. Please ask this question on an internal mailing list. If you are not an Oracle employee, please ask the employee that gave you this beta. As this is a beta, some functionality may not be operational yet, so I can't answer why this particular feature seems not to work.

  • Query on using Variables in Oracle Query

    Hi
    i am new to Oracle, i have tried extracting data from the Oracle Database using the following Query which includes 1 variable SYSDATE_UTS, however when i try to execute the Query i get an error. Please let me know what am i doing wrong and how can i correct it.
    Error Message
    ORA-06550: line 4, column 1:
    PLS-00428: an INTO clause is expected in this SELECT statement
    Oracle Query
    DECLARE SYSDATE_UTS NUMBER := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    BEGIN
    SELECT
    INCIDENT_NUMBER,
    to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME,
    ,GROUP_TRANSFERS
    ,LAST_MODIFIED_BY
    ,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
    ,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
    ,CASE
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
    ELSE 'UNKNOWN'
    END AS AGE_GROUP
    FROM IncidentDataBase
    and STATUS not in (4,5,6)
    and rownum <10;
    END;

    Hi Frank
    i am using the following Oracle Version
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    and Quest Toad for Oracle to write and execute the queries:
    Toad for Oracle Xpert
    Version 10.1.1.8
    The code i am using is:
    variable SYSDATE_UTS NUMBER;
    exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    SELECT
    INCIDENT_NUMBER,
    to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME
    ,GROUP_TRANSFERS
    ,LAST_MODIFIED_BY
    ,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
    ,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
    ,CASE
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
    ELSE 'UNKNOWN'
    END AS AGE_GROUP
    FROM IncidentDataBase
    WHERE STATUS not in (4,5,6)
    and rownum <10;
    Notes:
    1. When i put the cursor before "variable" (starting of the query) and execute the script i get an Error: ORA-00900: invalid SQL statement.
    2. When i put the cursor just before "SELECT" i get a pop up.
    a. it is a Toad window which displays the available variables (in this case :SYSDATE_UTS).
    b. gives me a dropdown option to select the type (by default VARCHAR2 is selected).
    c. there is a value field where i need to enter the value for the Variable.
    d. the SQL statement shown in this dilog box does not include the 1st 2 lines
    variable SYSDATE_UTS NUMBER;
    exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    Q: is there something wrong in the syntax i am using?
    Sven W. - I have been using your method all these days, which works just fine. i wanted to know how i could use a variable instead.
    Business Requirement - My whole intent is to calculate the Age of an incident (Difference between "Reported Date" and current date) and to assign Age Groups (0-1 Days, 2-4 Days,....,20+ Days).
    Edited by: 921713 on Mar 19, 2012 12:23 PM

Maybe you are looking for

  • Applocker Publisher Rule Not Working

    Hi, I've got an Applocker publisher rule for JDK 1.6.0_45 on a 2012 R2 server.  The dll's and exe's are signed by "Sun Microsystems, Inc." but despite the publisher rule, they are still being blocked.  When I run the following command: get-authentico

  • Process and commit behind a comand button

    new bee question i have created a application to update data within the database (ora 9.2). the user wishes to press a button that updates the data commits and then exits the form back to the previous form all seams easy ! but i can only do it in two

  • Pkgadd problems

    Hello everyone. I am trying to install gcc on my solaris 7 box, but I am out of disk space on the / partition. My question is: when running pkgadd where does it unpack the files to? If I knew the location I could create a symlink to a partition that

  • Dent in mac book pro?

    hey, i have a dent in my mac book pro from a picture frame falling down on from a shelf. will apple fix it if i go to a store? do you think they are going to charge me a fortune?

  • Weird Behavior, window moves unexpectedly, help

    I am very puzzled by my mac behavior. When I have a window open with columns in finder and click on a column that has about 40 files/folders, the sidebar starts moving up and down. If I click on a column that only has a few files there is no sidebar