Need PL/SQL Code to get Oracle connection string

Hi
Could you please give any solution to below requirement?
Requirement :
I have an existing pl/sql program (Registered as concurrent Program) in which i am calling a "C" Program. The "C" program expects a parameter to pass the value of oracle connection string (userid/pwd@instance). The C Program takes the connection string to connect to oracle and manipulate data.
Question. How will I get Oracle userid,pwd and connection string being in PL/SQL Session so that it will run for every instance i move the code in.
Note :
1.) We have limitations to call another concurrent program to fetch these data.
2.) We cannot hard code the value in the program because of compliance issue.
Any example of code will help.
Thanks in Advance.
Cheers
Samar

Hi,
Check the below link, It might help you.
http://download.oracle.com/docs/cd/B13789_01/appdev.101/b10802/d_obtool.htm
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adgsec04.htm
Twinkle

Similar Messages

  • Need pl/sql code to Encrypted data to decryption formate

    Hi All,
    I have Encrypted data 64 bit formate like
    encrypt
    780D0287
    FA57C55510D258C73DE93059E3DC49EC
    need output as a Decryption data..kindly give me output

    This is your duplicate post...
    Re: Need pl/sql code to decryption
    *009*

  • Error: java.sql.SQLException: Internal Error   Invalid Connect String

    hi,
    facing errror while deploying the process
    A problem occured while connecting to server "sfhyd1.softforce.com" using port "8888": bpel_getCustomerAccounts_1.0.jar failed to deploy. Exception message is: java.sql.SQLException: Internal Error:Invalid Connect String
    at com.collaxa.cube.engine.util.DBUtils.checkIfFatalConnectionError(DBUtils.java:920)
    at com.collaxa.cube.ejb.impl.BaseCubeSessionBean.checkIfFatalConnectionError(BaseCubeSessionBean.java:153)
    at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.deploySuitcase(BPELDomainManagerBean.java:462)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
    at com.evermind.server.ThreadState.runAs(ThreadState.java:693)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    at DomainManagerBean_RemoteProxy_4bin6i8.deploySuitcase(Unknown Source)
    at com.oracle.bpel.client.BPELDomainHandle.deploySuitcase(BPELDomainHandle.java:319)
    at com.oracle.bpel.client.BPELDomainHandle.deployProcess(BPELDomainHandle.java:341)
    at deployHttpClientProcess.jspService(_deployHttpClientProcess.java:376)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:400)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:414)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
    at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
    at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: Internal Error:Invalid Connect String
    at oracle.lite.poljdbc.POLJDBCErrMsg.throwSQLException(Unknown Source)
    at oracle.lite.poljdbc.LiteThinJDBCConnection.<init>(Unknown Source)
    at oracle.lite.poljdbc.LiteThinJDBCFactory.createConnection(Unknown Source)
    at oracle.lite.poljdbc.POLJDBCConnection.<init>(Unknown Source)
    at oracle.lite.poljdbc.OracleConnection.<init>(Unknown Source)
    at oracle.lite.poljdbc.POLJDBCDriver.connect(Unknown Source)
    at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:116)
    at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:75)
    at oracle.oc4j.sql.DataSourceConnectionPoolDataSource.getPooledConnection(DataSourceConnectionPoolDataSource.java:57)
    at oracle.oc4j.sql.xa.EmulatedXADataSource.getXAConnection(EmulatedXADataSource.java:92)
    at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createXAConnection(ManagedConnectionFactoryImpl.java:211)
    at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:170)
    at com.evermind.server.connector.ApplicationConnectionManager.createManagedConnection(ApplicationConnectionManager.java:1398)
    at oracle.j2ee.connector.ConnectionPoolImpl.createManagedConnectionFromFactory(ConnectionPoolImpl.java:327)
    at oracle.j2ee.connector.ConnectionPoolImpl.access$800(ConnectionPoolImpl.java:98)
    at oracle.j2ee.connector.ConnectionPoolImpl$FixedWaitPoolingScheme.getManagedConnection(ConnectionPoolImpl.java:1455)
    at oracle.j2ee.connector.ConnectionPoolImpl.getManagedConnection(ConnectionPoolImpl.java:785)
    at oracle.oc4j.sql.ConnectionPoolImpl.getManagedConnection(ConnectionPoolImpl.java:45)
    at com.evermind.server.connector.ApplicationConnectionManager.getConnectionFromPool(ApplicationConnectionManager.java:1596)
    at com.evermind.server.connector.ApplicationConnectionManager.acquireConnectionContext(ApplicationConnectionManager.java:1541)
    at com.evermind.server.connector.ApplicationConnectionManager.allocateConnection(ApplicationConnectionManager.java:1486)
    at oracle.j2ee.connector.OracleConnectionManager.unprivileged_allocateConnection(OracleConnectionManager.java:238)
    at oracle.j2ee.connector.OracleConnectionManager.allocateConnection(OracleConnectionManager.java:192)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:272)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:200)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:142)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:127)
    at com.collaxa.cube.engine.data.ConnectionFactory$ConnectionFactoryImpl.getConnection(ConnectionFactory.java:336)
    at com.collaxa.cube.engine.data.ConnectionFactory.getConnection(ConnectionFactory.java:140)
    at com.collaxa.cube.engine.adaptors.common.BaseProcessPersistenceAdaptor.storeProcess(BaseProcessPersistenceAdaptor.java:361)
    at com.collaxa.cube.engine.adaptors.olite.ProcessPersistenceAdaptor.storeProcess(ProcessPersistenceAdaptor.java:52)
    at com.collaxa.cube.engine.data.ProcessPersistenceMgr.storeProcess(ProcessPersistenceMgr.java:76)
    at com.collaxa.cube.engine.deployment.DeploymentManager.deployProcess(DeploymentManager.java:937)
    at com.collaxa.cube.engine.deployment.DeploymentManager.deploySuitcase(DeploymentManager.java:792)
    at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.deploySuitcase(BPELDomainManagerBean.java:455)
    ... 45 more

    You may possibly modified the oc4j-ra.xml file in the stand-alone directory instead of the file under the OC4J_BPEL directory in midtier.
    Currently, we are seeing some issues with the sample in midtier. So you may like to wait for the GA release [ mid May] for trying out this sample.
    Otherwise please send a mail to [email protected], you need any early drop of this sample.
    HTH.
    Thanks,
    Rakesh

  • Execute all SQL code as individual Oracle user, not APEX_PUBLIC_USER

    Is it possible to get APEX to execute SQL code as the user's existing Oracle database user instead of APEX_PUBLIC_USER?
    Besides having all of the security already defined for each of the existing users at the database level, the existing application also handles generating audit trails with triggers that pull the username executing the SQL instead of accepting passed values. At the moment APEX_PUBLIC_USER is plastered everywhere as the user that generated the changes.

    rcy_evdriver wrote:
    Is it possible to get APEX to execute SQL code as the user's existing Oracle database user instead of APEX_PUBLIC_USER? No. See:
    {message:id=926724}
    {message:id=1224601}
    {message:id=1606515}
    Application Express and parsing of SQL
    Besides having all of the security already defined for each of the existing users at the database level, the existing application also handles generating audit trails with triggers that pull the username executing the SQL instead of accepting passed values. At the moment APEX_PUBLIC_USER is plastered everywhere as the user that generated the changes.Using DAD Credentials Verification will cause the database user to be returned by the <tt>USER</tt> pseudo-column. (However just because you can do this, it doesn't mean you should.)
    {message:id=9680421}
    Why are you asking this? +"At the moment APEX_PUBLIC_USER is plastered everywhere as the user that generated the changes"+ indicates that it might be a bit late to be making fundamental discoveries about APEX and database security?

  • SQL - Database access using Oracle.connect(getCLass(), "connect.properties")..IM LOST

    Hi,
    I use Oracle.connect(getClass(),"connect.properties") before all of my #sql statements. If there are a bunch of methods with #sql statements, I use the connection method. I think this is my problem and Id like some feedback from other people.
    1) Should i be using an Oracle.connect statement before every #sql?
    2) If so, does it create new connections all the time or does it just know there is a current connection so it doesnt keep adding new connections?
    3) Is there a way to get one connection and then test to see if there is a connection so that i dont keep getting new connections?
    4) Do I have to close the connections? I tried Oracle.close(); but got some wierd errors. I read somewhere that If autocommit is true, you dont have to close jdbc connections.
    Thanks for your time and I appreciate any feedback that anyone has to offer.

    Hi Adam,
    Please find the answers inline.
    I use Oracle.connect(getClass(),"connect.properties") before all of my #sql statements. If there are a bunch of methods with #sql statements, I use the connection method. I think this is my problem and Id like some feedback from other people.
    1) Should i be using an Oracle.connect statement before every #sql?No, you don't have to call this each time, just call this once to intialize your DefaultContext and from then on, whenever
    #sql is used, it would fetch the connection from the DefaultContext.
    2) If so, does it create new connections all the time or does it just know there is a current connection so it doesnt keep adding new connections?No, it doesn't create connections each time.
    3) Is there a way to get one connection and then test to see if there is a connection so that i dont keep getting new connections?There would be only one connection
    4) Do I have to close the connections? I tried Oracle.close(); but got some wierd errors. I read somewhere that If autocommit is true, you dont have to close jdbc connections.The connection has to be closed explicitly using Oracle.close();
    For samples on using connect.properties refer to,
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/9i_sqlj/9i_sqlj.html#BatchingAndREFCursorSample
    Regards
    Elango.

  • Need PL/SQL code for this

    Hi,
    I need a PL/SQL code for this one...
    Let me know if something is not clear...
    1) The table CLOB_CLOBJECT_CDA has the columns described below...
    Explaining only those fields which are important in this context
    -- CDA_STEP_ID : Basically a Sequence
    -- CLOBJECT_SOURCE1_ID : Every id has got a set of records
    -- CLOBJECT_SOURCE2_ID : Every id has got a set of records
    -- LVL : There are total 8 levels..
    This is the main aim :
    1) There are total 16 million rows..(limited to 10 rows here)
    2) We need to go through level by level (LVL column) & insert the intersection records (CLOBJECT_SOURCE1_ID intersect CLOBJECT_SOURCE2_ID)
    into another table...but this is how it goes..
    Level (LVL column) 3's basically have CLOBJECT_SOURCE1_ID as level (LVL column) 2 CDA_STEP_ID's..
    (consider the statement --** where CLOBJECT_SOURCE1_ID = 285 which is same as 1st insert statement step id)..
    The above process goes for next levels until 8..(so have to use loops)
    So for ex :
    We go through the first insert statement and insert the insertion records only when both CLOBJECT_SOURCE1_ID & CLOBJECT_SOURCE2_ID has got records ..
    If we don't find any records for both of them we should skip the corresponding step id when we go to the next levels...
    Let's go through the 1st insert statement...
    -- We have CDA_STEP_ID = 285 & two sources CLOBJECT_SOURCE1_ID as 19 & CLOBJECT_SOURCE2_ID as 74...
    -- We see the table CLOBJECT_COUNTS & check whether we have counts for both 19 & 74 ..(In fact we insert counts into this table only if they have records)
    -- If so, we insert the intersection records into CDA_MRN_RESULTS ( we do have counts for both of them..) with CDA_STEP_ID 285...
    -- Then we insert the step id which is 285 along with the count into CLOBJECT_COUNTS..
    Let's go through another insert statement...
    -- Consider CDA_STEP_ID = 288 which has two sources CLOBJECT_SOURCE1_ID as 19 & CLOBJECT_SOURCE2_ID as 92...
    -- We see the table CLOBJECT_COUNTS & check whether we have counts for both 19 & 92 ..(we have records for 19 but not for 92)
    -- So we should not proceed with this..& also skip all those records (future records with increasing levels..basically level 3's) which have got 288 as CLOBJECT_SOURCE1_ID..
    (As said earlier that the present CDA_STEP_ID will always be CLOBJECT_SOURCE1_ID in the next level)...
    I wrote the following code which is after the statement...
    Let me have the create & insert statements here..
    create table CLOB_CLOBJECT_CDA
        CDA_STEP_ID           NUMBER,
        CDA_ID                NUMBER,
        CDA_SEQ_NUMBER        NUMBER,
        CLOBJECT_SOURCE1_TYPE VARCHAR2(3000),
        CLOBJECT_SOURCE1_ID   NUMBER,
        CLOBJECT_OPERATOR     VARCHAR2(3000),
        CLOBJECT_SOURCE2_TYPE VARCHAR2(3000),
        CLOBJECT_SOURCE2_ID   NUMBER,
        LVL                   NUMBER
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (285, 285, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 74, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (286, 286, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 75, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (287, 287, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 91, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (288, 288, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 92, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4869, 4869, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 91, 3);  -- **
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4870, 4870, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 92, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4871, 4871, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 93, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4880, 4880, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 91, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4881, 4881, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 92, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4882, 4882, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 93, 3);
    create table CDA_MRN_RESULTS
       CDA_STEP_ID      NUMBER,
      MRN              NUMBER,
      INSERT_DATE_TIME DATE
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19, 1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19,  3, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  4, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  6, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (91,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (91,  3, to_date('19-10-2011', 'dd-mm-yyyy'));
    create table CLOBJECT_COUNTS
      CDA_STEP_ID    NUMBER,
      CLOBJECT_COUNT NUMBER,
      DATE_TIME      DATE
    Insert into CLOBJECT_COUNTS values (19,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (74,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (75,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (91,2, to_date('19-10-2011', 'dd-mm-yyyy'));The output goes into two tables...
    CDA_MRN_RESULTS : O/p of intersection records between source1 & source2 id
    CLOBJECT_COUNTS : Step id with counts ...(useful for skipping next level step id's if either of source id has "0" counts)
    Any help is appreciated..
    Thanks..

    I tried to code this..but looping takes a lot of time..I want to skip certain rows where source1_step_id & source_2_step_id are not in clobject_counts table as we proceed to the next levels..Not sure how to skip the rows..
    declare
    cursor c1 (p_level varchar2 ) is
      Select * from clob_clobject_cda
        where lvl = p_level    ;
       TYPE V_TT IS TABLE OF C1%ROWTYPE INDEX BY PLS_INTEGER;
        L_TT V_TT;
        v1 number;
        v2 number;
        v_step_id number;
        v_operator varchar2(100) := '';
    begin
    for i in 2..8 loop
      open c1(i);
      LOOP
           FETCH C1 BULK COLLECT INTO L_TT LIMIT 500;
            FOR indx IN 1 .. L_TT.COUNT
             LOOP
               v1 := L_TT(indx).clobject_source1_id;
               v2 := L_TT(indx).clobject_source2_id;
               v_step_id := L_TT(indx).cda_step_id;
               v_operator := L_TT(indx).clobject_operator;
      Execute Immediate ('Insert into cda_mrn_results Select --+ parallel (cm 128)
                                                      distinct ' || v_step_id || ', mrn, trunc(sysdate) dt from cda_mrn_results  cm
                        where cda_step_id = ' || v1 || '
                        and   cda_step_id in (Select cda_step_id from clobject_counts) ' ||
         v_operator ||
                    '  Select --+ parallel (cm 128)
                                                      distinct ' || v_step_id || ', mrn, trunc(sysdate) dt from cda_mrn_results  cm
                        where cda_step_id = ' || v2 || '
                        and   cda_step_id in (Select cda_step_id from clobject_counts)  ' );
    Insert --+ Append
           into clobject_counts Select cda_step_id, count(distinct mrn),
                       insert_date_time dt from cda_mrn_results  where cda_step_id =  v_step_id   group by cda_step_id,insert_date_time;
       COMMIT;                    
             END LOOP;
           EXIT WHEN L_TT.COUNT = 0;
         END LOOP;
      CLOSE C1;
    End Loop;    
    Commit;
    End;

  • Getting socket error while trying to get oracle connection using JDBC

    hi,
    I am getting following socket read error while trying to get database connection using JDBC. This happening with jdk1.5.0_12 version with Oracle 9i
    following is the stacktrace...
    Thread t@92: (state = IN_NATIVE)
    - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Compiled frame; information may be imprecise)
    - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129 (Compiled frame)
    - oracle.net.ns.Packet.receive() @bci=31 (Compiled frame)
    - oracle.net.ns.DataPacket.receive() @bci=1 (Interpreted frame)
    - oracle.net.ns.NetInputStream.getNextPacket() @bci=48 (Compiled frame)
    - oracle.jdbc.driver.T4CMAREngine.unmarshalSB1() @bci=1, line=1070 (Compiled frame)
    - oracle.jdbc.driver.T4CStatement.doOall8(boolean, boolean, boolean, boolean) @bci=617, line=207 (Compiled frame)
    - oracle.jdbc.driver.T4CStatement.executeForDescribe() @bci=39, line=790 (Compiled frame)
    - oracle.jdbc.driver.OracleStatement.executeMaybeDescribe() @bci=106, line=1039 (Interpreted frame)
    - oracle.jdbc.driver.T4CStatement.executeMaybeDescribe() @bci=11, line=830 (Interpreted frame)
    - oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout() @bci=128, line=1132 (Interpreted frame)
    - oracle.jdbc.driver.OracleStatement.executeQuery(java.lang.String) @bci=76, line=1272 (Interpreted frame)
    any help would appreciated. thanks in advance

    I do not have exact exception message.
    additionally, i have got following the tomcat log file:
    INFO - Resource pool cleanup thread just woke up.
    Nov 1, 2008 3:41:52 AM org.apache.tomcat.util.threads.ThreadPool logFull
    SEVERE: All threads (100) are currently busy, waiting. Increase maxThreads (100) or check the servlet status
    INFO - Resource pool cleanup thread just woke up.
    thanks in advance

  • How to get the connection string at runtime

    Hi,
    I'm using Forms6i.
    I'm using EXEC_SQL to execute a dynamic sql in my form.
    I need connection string for that . But i cannot give it hardcodingly.
    Is there any form's properties to get the database connection string, to which the form is connected ?
    Thanks

    Hi,
    I've the user i/p columns
    EmpNo, Dept ,Holicode and , From and To Date.
    In which From and To Date is mandatory.
    In one table, emp_cal_header, i have all the holidays defined for each of the employees for a year.
    The records like
    EmpNo    Holicode     Holidt
    001        Frioff         02/07/2011
    001        Satoff        03/07/2011
    001        Frioff         08/07/2011
    .....So i want the final o/p in Excel like
    If user i/p is from Date: 01/07/2011 ,ToDate:09/07/2011, EmpNo :001
    EmpNo   Dept     Total  01/07/2011   02/07/2011 ..... 08/07/2011  09/07/2011
    001        IT        3               FriOff           Frioff            For this i'm constructing a dynamic sql like this
         qry := '(Select ech_emp_code cal_emp_code,emp_name CAL_EMP_NAME,emp_dept CAL_EMP_DEPT,count(ech_date) CAL_TOTAL'||date_cols||'
                             from (Select ech_emp_code,em.emp_name||'' ''||em.emp_middle_name||'' ''||em.emp_last_name emp_name,em.emp_dept emp_dept,ech_code,ech_desc,ech_date
                                            from emp_cal_header ,employee_master em
                                where emp_cal_header.ech_emp_code = em.emp_code
                                and  ech_emp_code = '||nvl(:emp_code,'ech_emp_code')
                                ||' and em.emp_status IN (''P'',''C'')'
                                ||' and em.emp_dept = '||dep
                                ||' and ech_date between '''||to_date(to_char(:From_dt,'DD-MON-YYYY'))
                                ||''' and '''  ||to_date(to_char(:To_dt,'DD-MON-YYYY'))
                                ||''' and ech_code = '||holi
                                ||' order by ech_Date)
                 group by ech_emp_code,emp_name,emp_dept)';
    and date_cols is constructed as
         todt := :from_dt ;
         i := 0;
         loop
              i := i+1;
              dt  := to_char(todt,'dd-MON-YYYY');
              date_cols     := date_cols||','||'max(decode(to_char(ech_date,''dd-MON-YYYY''),'''||dt||''',ech_CODE)) DT'||i;
              todt := todt + 1;
              Exit when todt > :to_dt ;
         End loop;This query i'm executing using EXEC_SQL.
    Since date_cols can be constructed only based on user i/p , i'm not able to do just a normal query
    Any help

  • BC4J HOW Can I GET the CONNECTION String

    hi everyone
    I'm using Jdev 3.2. In my BC4J prooject I want to get the current connection String used by the application module to connect to database.
    can some one help me please.
    Ghassen

    I don't know what's really the problem, but I recomplie the same code and I receive the same error.
    I added also the import statement: import oracle.dacf.dataset.connections.NamedConnection.
    and I receive the same error message.
    can that be a mising library problem?
    ghassen
    null

  • Oracle connection string - jdbc format

    I'm having issues connecting to an Oracle database from asp.net (C#) - Visual Studio 2013.
    I've installed odp.net and in my project I see references for System.Data.OracleClient (Framework tab) and Oracle.DataAccess and Oracle.Web (Extensions tab).
    Tried all of those, but getting a problem with the connection string.
    Our dbas have given us only one format of connection string that will work, listed below:
    jdbc:oracle:thin:@ldap://oid.inf.mycompany.com:3060/myserviceName1,cn=OracleContext,dc=ute,dc=mycompanyname,dc=com
    This works fine for developers who use Weblogic, but I can't get this to work with C#.
    I put the above value in web.config and use the below code:
    using System.Data.OracleClient;
    //using Oracle.DataAccess.Client;
                    using (OracleConnection conn = new OracleConnection())
                        try
                            conn.ConnectionString = Properties.Settings.Default.sqlConnStr;
                            //SqlCommand cmd = conn.CreateCommand();
                            OracleCommand cmd = conn.CreateCommand();
                            cmd.CommandText = Properties.Settings.Default.sqlQuery1;
                            cmd.CommandType = System.Data.CommandType.Text;
                            //cmd.CommandTimeout = 10;
                            conn.Open();
                            log.Info("Getting local users from db");
                            //SqlDataReader dr = cmd.ExecuteReader();
                            OracleDataReader dr = cmd.ExecuteReader();
                            while (dr.Read())
    using this, I get errors like below:
    System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
    at:
    conn.Open();
    another error seen below:
    System.ArgumentException: Keyword not supported: 'jdbc:oracle:thin:@ldap://oid.inf.mycompany.com:3060/myserviceName1,cn'.
    at: 
    conn.ConnectionString = Properties.Settings.Default.sqlConnStr;
    Even if these errors can be resolved, how would I specify a user id and password for this format of connection string?
    Thanks for any help you can provide,

    Hello simplify,
    For issues regarding Oracle, I would suggest that you could post it to the Oracle forum:
    https://community.oracle.com/welcome
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Need a sql query to get multiple dates in rows

    Hi All,
    i need a query to get dates for last 7 days and each dates should be in one row...
    but select sysdate from dual..gives one row...
    Expexcted Output
    Dates:
    01-oct-2013
    30-sep-2013
    29-sep-2013
    28-sep-2013
    27-sep-2013
    26-sep-2013

    Hi,
    Do you mean that you want all 7 dates together on 1 row?
    Here's one way:
    SELECT LISTAGG ( TO_CHAR ( SYSDATE + 1 - LEVEL
                              , 'DD-Mon-YYYY'
                    ) WITHIN GROUP (ORDER BY LEVEL)    AS txt
    FROM    dual
    CONNECT BY LEVEL <= 7
    This is an example of String Aggregation, that is, taking a column on multiple rows, and concatenating all the values (however many htere happen to be) into 1 big string column 1 row.
    Like everything else, exactly how to do it depends on your Oracle version.
    For more on String Aggregation, including differetn techniques for different versions, see http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    Message was edited by: FrankKulash
    Sorry, I mis-read the question.

  • Very urgent....Please hlep..Need pl/sql code

    Hi,
    I need to write a pl/sql programe to check a particular number ,lets say '1234' which can be there in any of the columns in the user defined tables.I need to list down all the tables which contains that particular number in any of the columns.
    For eg- Let user defined table(user_tab_cols) contain 10 different user defined tablws say 'table1','table2',table3' and so on...till 'table10'.I need to check the particular number '1234' in those table's column and listed all the table which contains data '1234' in any of their columns.
    please help me............

    Hi,
    Thanks a lot for helping me out.I apologies for not following the forum netiquette and being demanding.
    Mean time as you said i have done some research and coded something which worked for me but so many performance issue.Please have a look in to the below code and please suggest the mistakes i have done here.
    CREATE OR REPLACE procedure search_db (p_search varchar, p_type varchar)
    * This procedure will search a user's schema (all tables) for columns matching the user's input.
    * ####### Please create the following table before you run this procedure:
    * create table search_db_results(result varchar2(256));
    * This table will contain the result of the procedure run so that you can view intermediate search results while the procedure is running.
    * You pass two parameters to this procedure:
    * 1) Search string / number / date (REQUIRED)
    * 2) Search datatype (REQUIRED)
    * Example:
    * exec search_db('hello','VARCHAR2') -- will search for rows in all tables that have a VARCHAR2 column with "hello" as the data.
    * exec search_db('01-JAN-2008','DATE') -- will search for all rows in all tables that have a DATE column with the data '01-JAN-2008' in it.
    * exec search_db(1000,'NUMBER') -- will search for all rows in all tables that have a NUMBER column with the data 1000 in it.
    * Allowed data types: VARCHAR2, CHAR, DATE, NUMBER, FLOAT.
    IS
    TYPE tab_name_arr IS VARRAY(10000) of varchar2(256);
    v_tab_arr1 tab_name_arr; /* ARRAY TO HOLD ALL TABLES IN THE USER SCHEMA */
    v_col_arr1 tab_name_arr; /* ARRAY TO HOLD ALL COLUMNS IN EACH TABLE */
    v_amount_of_tables number(10); /* this holds the amount of tables in the current user schema so that the for loop will know how many times to run */
    v_amount_of_cols number(10); /* when searching in a table, this holds the amount of columns in that table so that the for loop searching the table will know how many iterations it needs */
    v_search_result number(10); /* when searching the table, this holds the amount of results found. We use this is that if the amount of result found is greated than 0 we will print the name of the table and the column */
    v_result_string varchar2(254);
    BEGIN
    v_tab_arr1 := tab_name_arr(); /*INITIALIZE THE ARRAY*/
    v_col_arr1 := tab_name_arr(); /*INITIALIZE THE ARRAY*/
    v_col_arr1.EXTEND(1000); /* INITIALIZE THE ARRAY to the maximum amount of columns allowed in a table */
    /* This will return the amount of tables in the user schema so that we know how many times we need to invoke the for loop */
    select count(table_name)
    into v_amount_of_tables
    from user_tables;
    v_tab_arr1.EXTEND(v_amount_of_tables); /*INITIALIZE THE ARRAY to the number of tables found in the user's schema */
    FOR i in 1..v_amount_of_tables LOOP /*LOOP until we reach the maximum amount of tables in the user schema */
    /* start populating the tables array with table names. The data is read fomr the data dictionary */
    select table_name
    into v_tab_arr1(i)
    from
    select rownum a, table_name
    from user_tables
    order by table_name
    where a = i;
    END LOOP;
    /* now, after we have an array with all the names of the tables in the user's schmea, we'll start going
    over each table and get all of its columns so that we can search every column */
    FOR i in 1..v_amount_of_tables LOOP
    /*select the amount of columns in the table where the data_type matches the data type the user passed as a parameter to the procedure */
    select count(*)
    into v_amount_of_cols
    from user_tab_columns
    where table_name = v_tab_arr1(i)
    and data_type = p_type;
    /* start searching the clumns ONLY IF there is at least one column with the requested data type in the table */
    if v_amount_of_cols <> 0 then
    /* do the search for every column in the table */
    FOR j in 1..v_amount_of_cols LOOP
    select column_name
    into v_col_arr1(j)
    from
    select rownum a, column_name
    from user_tab_columns
    where table_name = v_tab_arr1(i)
    and data_type = p_type
    where a = j;
    /* each type of data_type has its own SQL query used to search. Here we execute different queries based on the user passed parameter of requested data type */
    IF p_type in ('CHAR', 'VARCHAR2', 'NCHAR', 'NVARCHAR2') then
    execute immediate 'select count(*) from ' || v_tab_arr1(i) || ' where ' || lower(v_col_arr1(j)) || ' like ' || '''' || '%' || lower(p_search) || '%' || '''' into v_search_result;
    end if;
    if p_type in ('DATE') then
    execute immediate 'select count(*) from ' || v_tab_arr1(i) || ' where ' || v_col_arr1(j) || ' = ' || '''' || p_search || '''' into v_search_result;
    end if;
    if p_type in ('NUMBER', 'FLOAT') then
    execute immediate 'select count(*) from ' || v_tab_arr1(i) || ' where ' || v_col_arr1(j) || ' = ' || p_search into v_search_result;
    end if;
    /* if there is at least one row in the table which contains data, return the table name and column name */
    if v_search_result > 0 then
    v_result_string := v_tab_arr1(i) || '.' || v_col_arr1(j);
    execute immediate 'insert into search_db_results values (' || '''' || v_result_string || '''' || ')';
    commit;
    end if;
    END LOOP;
    end if;
    end loop;
    END;
    /

  • Need a sql query to get the difference between two timestamp in the format of hh:mm:ss.msec

    I have a database table where it keeps record of the transaction when it starts at StartTime and when it ends at EndTime. Both these entries are having the timestamp entries. Say for example, I have a tuple with Entries like 'Transaction A' starts at '2014-05-07
    20:55:03.170' and ends at '2014-05-08 08:56:03.170'. I need to find the difference between these two timestamps and my expected output is 12:01:00.000. Let me know how to achieve this ? 

    Hi,
    You can use below script which calculates difference as DD:HH:MM:SS. You can modify the same:
    DECLARE @startTime DATETIME
    DECLARE @endTime DATETIME
    SET @startTime = '2013-11-05 12:20:35'
    SET @endTime = '2013-11-10 01:22:30'
    SELECT [DD:HH:MM:SS] =
    CAST((DATEDIFF(HOUR, @startTime, @endTime) / 24) AS VARCHAR)
    + ':' +
    CAST((DATEDIFF(HOUR, @startTime, @endTime) % 24) AS VARCHAR)
    + ':' +
    CASE WHEN DATEPART(SECOND, @endTime) >= DATEPART(SECOND, @startTime)
    THEN CAST((DATEDIFF(MINUTE, @startTime, @endTime) % 60) AS VARCHAR)
    ELSE
    CAST((DATEDIFF(MINUTE, DATEADD(MINUTE, -1, @endTime), @endTime) % 60)
    AS VARCHAR)
    END
    + ':' + CAST((DATEDIFF(SECOND, @startTime, @endTime) % 60) AS VARCHAR),
    [StringFormat] =
    CAST((DATEDIFF(HOUR , @startTime, @endTime) / 24) AS VARCHAR) +
    ' Days ' +
    CAST((DATEDIFF(HOUR , @startTime, @endTime) % 24) AS VARCHAR) +
    ' Hours ' +
    CASE WHEN DATEPART(SECOND, @endTime) >= DATEPART(SECOND, @startTime)
    THEN CAST((DATEDIFF(MINUTE, @startTime, @endTime) % 60) AS VARCHAR)
    ELSE
    CAST((DATEDIFF(MINUTE, DATEADD(MINUTE, -1, @endTime), @endTime) % 60)
    AS VARCHAR)
    END +
    ' Minutes ' +
    CAST((DATEDIFF(SECOND, @startTime, @endTime) % 60) AS VARCHAR) +
    ' Seconds '
    Reference:
    http://sqlandme.com/2013/12/23/sql-server-calculating-elapsed-time-from-datetime/
    - Vishal
    SqlAndMe.com

  • Oracle connection string not working

    Dear all,
    For staging of DQC on oracle does not appear to work. SP2 admin guide offers four different ways to input server name incl:
    1. server name/service name
    2. FQDN/port number/sid
    3. ip address/port number/sid
    4 TNS entry
    I've tried the first three syntax but were unsuccessful. Please suggest what syntax to use. We are on oracle 10g, NW CE7.2 with DQC SP2.
    Best regards.
    Mohammad

    Thanks Stephen,
    It didn't connect... the message appears:
    Connection Failed:Bad packet type. Bad packet type.
    CDS log has following info:
    ERROR com.nakisa.Logger  - com.nakisa.framework.data.commandProcessor.impl.SqlServerCommandProcessor : getDataTables : Could not create a database connection. Data Element Name:
    When I check the db connection with the nksadm user... it successfully logs on to oracle and shows db is in running state. Also all oracle services are up without any issue.
    Our build is SP2 - 0702015700 on NW CE7.2 (no SP) and oracle 10g.
    Any ideas, and thanks for the support.
    Best regards

  • Addon Connection String

    Hello Forum,
    we developed in our company an individual interface between SAP B1 and another software. We did this without the SDK...
    Now we want to register the Add On. I think for this we need a connection string. Is that right? I asked SAP for a solution license with a BASIS number. But now I can't generate the connection string. The SAP system says that a license is missing. I found out that I need a SDK Developement License. But we don't want to sell the interface just use it in our company. So do I have to use the connection string solution or is there a another, better way?
    I hope somebody can help me.
    Sincerely
    S. Jaiser

    With the followed code I get the connection string to modify for a dataadpater, conneciont,...
        Private Sub Class_Initialize_Renamed()
            '1.- conectar con SAP
            SetApplication()
    '.... more code
    Dim oCompany As New SAPbobsCOM.Company
    '... more code
    'strcnn is declared as a readonly property in Application class.
      strcnn = "Provider=sqloledb;" & _
                         "Data Source=" & oCompany.Server & ";" & _
                         "Initial Catalog=" & oCompany.CompanyDB & ";" & _
                         "User Id=" & oCompany.DbUserName & ";" & _
                         "Password=" & gsINI_DBPassword & ";"
    'gsINI_DBPassword are typed from user
    '... more code

Maybe you are looking for

  • How can I turn off messages on iPad while students are at school

    Is there any great way to turn off messages on the ipad without shutting down the ports required to connect to Apple on the firewall? Kids will be kids but teachers are pressing administration for solution. If you shut off messages, I may be mistaken

  • How do you get Home Sharing back?

    I was checking out the Home Sharing option on iTunes 9, and I accidentally clicked the option that got rid of it. I recently fixed my internet, and I really want to use Home Sharing, but don't see the option anywhere.

  • Email on Visual Approval and offline form as attachment in UWL

    Hello, I have a process which is like this 1) User to fill a form which on submit will go for approval. 2) On approval or rejection a mail to be sent to the person who submitted the offline form I have done the following 1) Create a offline form whic

  • When will iphone 5 be sold unlocked?

    i want it unlocked beacause i spent many time in europe so i have other sims..

  • Synchronizing music that appears in multiple playlists.

    I just got my new iPhone 3G today, so please forgive me if this is a really basic question I'm wondering if the iTunes sync software is smart enough to not duplicate songs that are sync'd to the phone. In other words, I have selected multiple playlis