Which sequence used in which procedure/procedures?

how can i know which sequence used in which procedure/procedures?
can i get it from any system view?

855516 wrote:
how can i know which sequence used in which procedure/procedures?
can i get it from any system view?You can search DBA/USER/ALL_SOURCE for each sequence name. Logic could look something like
foreach sequence name in dba_sequences
  search dba_source for sequence nameRemember that code can be written using upper or lower case :)

Similar Messages

  • Deski report which is using a Store Procedure - Redirecting connection

    I have a DeskI report which is using a Store Procedure as its data provider.
    This is an Oracle based Store Procedure.
    Where can i see wich connection (connections listed in CMC) is used in DeskI report ?
    How can i redirect one connection to point to another on report?
    Thanks
    Georg

    Marina,
    The strategy for displaying LOV via Infoview needs to be different than what you've set up via DeskI.  The main difference is that when using a client/server program like DeskI, the LOV is cached to the client, thus producing a list more quickly, however, over the web, the web client does not cache LOV as readily.  To "solve" this "problem" you need to go back to your universe and trace what is happening.  If the LOV is getting generated through an essential "select distinct" on the fact/dimension table, and that table has over a million rows, then it will take some time to generate the list (and thus will timeout).  A different strategy to take is to maintain a "backend lookup" table that the LOV will point to instead.  The backend lookup table will contain the unique instances of the column getting scanned and thus when the LOV points to the new lookup table the response will be quicker versus the old method.  Care must be taken each time new data is loaded to WH to ensure that any new unique values from the "home" table/column are also placed in the backend lookup table.
    thanks,
    John

  • In which procedure a table is used

    Hi,
    I am using oracle 9iR2 on red hat 4 (64 bit).
    I want to check a specific table is used in which procedures?
    Thanks

    Hi,
    you find referenced tables for procedure
    select *  from DBA_DEPENDENCIES
    where OWNER = <your_procedure_owner>
      and REFERENCED_TYPE='TABLE'
      and TYPE= 'PROCEDURE'
      and NAME = <procedure_name>;Regards
    Mahir M. Quluzade
    www.mahir-quluzade.com

  • Which procedure is executing?

    Hi,
    Is there a way to know which procedure, in a pl/sql block, is running? I need put the procedure/function name into a string variable.
    procedure doSomething is
    begin
    // In that moment doSomething is running!
    end;
    Thanks,
    Leonardo Luiz

    Maybe use calls to dbms_application_info:
    create procedure doSomething (...)
    as
    begin
    dbms_application_info.set_client_info( 'proc: doSomething'||'...' );
    for x in ( ... )
    loop
    dbms_application_info.set_action( 'Progress ' || '...' );
    end loop;
    end;
    This will show up in the view v$session.

  • Which procedures are registered on an alert?

    Hi,
    I'm working on a big and (for me) new system which uses (a lot of) alerts.
    Is there a way to find out, which procedures are registered or listening on alert XYZ?
    Thanks
    Mephi

    select * from dba_source
    where lower(text) like '%dbms_alert.register%';
    OWNER                          NAME                           TYPE               LINE TEXT                                             
    SYS                            DBMS_ALERT                     PACKAGE              39   --      dbms_alert.register('emp_table_alert');
    1 row selected.if your "alert"-message is not dinamic, then
    select distinct owner, name, type
    from dba_source
    where lower(text) like '%dbms_alert.register%'
    intersect
    select distinct owner, name, type
    from dba_source
    where lower(text) like lower('%alertXYZ%')

  • Which procedures are invoked?

    Hi,
    I am using an application which uses huge amount of procedures in the background. I need to know which procedures are getting executed when I do something in the application.
    Does anybody know how to get the list of the procedures executed in the given time?
    OR
    It will be ok if I get the list of the tables which are updated / inserted in the given time.
    Thanks.
    Nilesh

    you can try to query on v$sqlarea
    select first_load_time, sql_text
      from v$sqlarea
    where first_load_time like '2006-01-27%'note that the column first_load_time is not a date datatype

  • Which user and which procedure takes snapshots for AWR in 10g??

    Hi, all.
    Which user and which procedure takes snapshots for AWR in 10g??
    The snapshot interval is 1 hour.
    I checked dba_scheduler_job, and dba_job.
    However, I was not able to find a job which takes a snapshot.
    On EM, I can see snapshots are being taken per one hour.
    Thanks and Regards.
    Message was edited by:
    user507290

    Dear Shmyg and VAS.
    Thanks for your reply.
    MMON takes a snapshot and stores snapshot information in DBA_HIST_** tables.
    Right??
    Does MMON have something to do with dbconsole and emagent??
    Even when I stopped dbconsole and emagent, snapshots are being taken.
    If so, what does do dbconsole and emagent??
    Thanks and Regards.
    Message was edited by:
    user507290

  • See which procedure is hanging

    One of my users is running a package and within the package a particular procedure keeps hanging but he doesnt know which one. Is there as a dba to see which procedure is mucking things up?
    thanks in advance
    SR

    I found another one too, this works as well.
    Thanks for all the responses
    ----Queries the job that is running during the current session
    ---get session id (sid) from oracle instance manager
    select t.sql_text
    from v$sqltext t, v$session s
    where s.sid = 48 and s.sql_address = t.address
    order by t.piece
    SR

  • ORA-04030: out of process memory when using Java Stored Procedures

    Hello,
    I have a problem using Java Stored Procedures in Oracle 10g.
    My Java application performs http posts to a webservice and the response is parsed in order to populate some DB tables.
    There is a scheduled job which calls the Java Stored Procedure every x minutes.
    No matter of the 'x minutes' values - after about 160 - 200 calls I get this error:
    ORA-04030: out of process memory when trying to allocate 1048620 bytes (joxp heap,f:OldSpace)
    ORA-04030: out of process memory when trying to allocate 2097196 bytes (joxp heap,f:OldSpace)
    The job stops just while is posting the http request. The weird thing is that almost each time the first http post request I get this error:
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:426)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
         at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
         at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    and the second try works fine.
    So, The out of process memory occured each time just before getting such an error, and I suspect to be a connection between these errors.
    Tech details:
    1. OS: WinXP
    2. Oracle 10.1.0.2.0
    3. To perform http post I use HttpClient 3.1 from Apache.
    4. I checked the http connection to be closed each time, and this is done.
    5. I checked the oracle statement and connection to be closed each time and this is done
    6. The JVM error (logged in .trc files of Oracle) is:
    java.lang.OutOfMemoryError
         at java.lang.Thread.start(Native Method)
         at sun.security.provider.SeedGenerator$ThreadedSeedGenerator.run(SeedGenerator.java:297)
    DB Settings details:
    Starting up ORACLE RDBMS Version: 10.1.0.2.0.
    System parameters with non-default values:
    processes = 200
    sessions = 225
    shared_pool_size = 159383552
    large_pool_size = 8388608
    java_pool_size = 104857600
    nls_language = AMERICAN
    control_files = C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL01.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL02.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL03.CTL
    db_block_size = 8192
    db_cache_size = 29360128
    compatible = 10.1.0
    fal_client = XXXXXX
    fal_server = XXXXXXs
    log_buffer = 524288
    log_checkpoint_interval = 100000
    db_files = 70
    db_file_multiblock_read_count= 32
    db_recovery_file_dest = C:\oracle\product\10.1.0\flash_recovery_area
    db_recovery_file_dest_size= 2147483648
    standby_file_management = AUTO
    undo_management = AUTO
    undo_tablespace = undotbs_01
    undo_retention = 14400
    remote_login_passwordfile= EXCLUSIVE
    db_domain =
    dispatchers = (PROTOCOL=TCP) (SERVICE=XXXXXXXDB)
    remote_dependencies_mode = SIGNATURE
    job_queue_processes = 4
    parallel_max_servers = 5
    background_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\BDUMP
    user_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\UDUMP
    max_dump_file_size = 10240
    core_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\CDUMP
    sort_area_size = 1048576
    sort_area_retained_size = 1048576
    db_name = XXXXXX
    open_cursors = 500
    optimizer_mode = FIRST_ROWS
    pga_aggregate_target = 25165824
    Any help would be appreciated. Thanks.
    Can be a problem with JVM threading under Oracle ?

    The server prcess failed to allocate more memory for large objects ( in Oldspace).
    If you Google ORA-04030, you will see several recommendations to work around this.
    The Java VM in the database already has HttpClient, i don't know why you are loading the Apache HttpClient but this might not be the surce of the problem.
    Kuassi http://db360.blogspot.com

  • Need help with BC4J/Struts application using a Stored Procedure

    Hi,
    I am doing a proof of concept for a new project using JDeveloper, Struts and BC4J. We want to reuse our Business logic that is currently residing in Oracle Stored Procedures. I previously created a BC4J Entity Object based on a stored procedure Using Oracle Stored Procedures but this stored procedure is a bit different in that it returns a ref cursor as one of the paramters. http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html
    I tried the above method, but I am having some trouble with it. I keep getting the error ORA-01008: not all variables are bound when I test it using the AppModule tester.
    Here is the store procedure definition:
    CREATE OR REPLACE PACKAGE pprs_test_wrappers IS
    TYPE sn_srch_results IS REF CURSOR;
    PROCEDURE sn_srch_main_test
    (serial_num_in IN OUT VARCHAR2
    ,serial_coll_cd_in IN OUT NUMBER
    ,max_rows_allowed IN OUT NUMBER
    ,total_rows_selected IN OUT NUMBER
    ,message_cd_out IN OUT VARCHAR2
    ,query_results          OUT sn_srch_results
    END pprs_test_wrappers;
    And here is my code:
    package pprs;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class LienCheckImpl extends ViewObjectImpl
    * This is the PLSQL block that we will execute to retrieve the REF CURSOR
    private static final String SQL =
    "begin ? := pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
    public LienCheckImpl() {}
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will PRECEED the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params (for example due to a view link)
    * they will be in the 'params' array.
    * We assume that if some parameter is present, that it is a Deptno
    * value to pass as an argument to the stored procedure.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    String serialNumIn = null;
    BigDecimal serialCollCdIn = null;
    BigDecimal maxRowsAllowed = null;
    BigDecimal totalRowsSelected = null;
    String messageCdOut = null;
    if (params != null) {
    serialNumIn = (String)params[0];
    serialCollCdIn = (BigDecimal)params[1];
    maxRowsAllowed = (BigDecimal)params[2];
    totalRowsSelected = (BigDecimal)params[3];
    messageCdOut = (String)params[4];
    storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
    serialCollCdIn,
    maxRowsAllowed,
    totalRowsSelected,
    messageCdOut));
    super.executeQueryForCollection(qc, params, numUserParams);
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overridden framework method.
    * The role of this method is to "fetch", populate, and return a single row
    * from the datasource by calling createNewRowForCollection() and populating
    * its attributes using populateAttributeForRow().
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    populateAttributeForRow(r,2, rs.getString(3));
    populateAttributeForRow(r,3, rs.getString(4));
    populateAttributeForRow(r,4, rs.getString(5));
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    * Overridden framework method.
    * Return true if the datasource has at least one more record to fetch.
    protected boolean hasNextForCollection(Object qc) {
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    * Overridden framework method.
    * The framework gives us a chance to clean up any resources related
    * to the datasource when a query collection is done being used.
    protected void releaseUserDataForCollection(Object qc, Object rs) {
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,
    String serialNum,
    BigDecimal serialColCd,
    BigDecimal maxRows,
    BigDecimal totalRows,
    String messageCd ) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type CURSOR
    st.registerOutParameter(1,OracleTypes.CURSOR);
    * Set the value of the 2nd bind variable to pass id as argument
    if (serialNum == null) st.setNull(2,Types.CHAR);
    else st.setString(2,serialNum);
    if (serialColCd == null) st.setNull(3,Types.NUMERIC);
    else st.setBigDecimal(3,serialColCd);
    if (maxRows == null) st.setNull(4,Types.NUMERIC);
    else st.setBigDecimal(4,maxRows);
    if (totalRows == null) st.setNull(5,Types.NUMERIC);
    else st.setBigDecimal(5,totalRows);
    if (messageCd == null) st.setNull(6,Types.CHAR);
    else st.setString(6,messageCd);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Number
    private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new oracle.jbo.domain.Number(b) : null;
    catch (SQLException s) { }
    return null;
    I created the view object in expert mode so there is no entity object. Can someone help? I don't have much time left to finish this.
    Also, could I have done this from the Entity object instead of the view object by registering the ref cursor OUT parameter in handleStoredProcInsert()?
    Thanks
    Natalie

    I was able to get the input parameter by putting the following in my struts actions class
    vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
    The full code is:
    package mypackage2;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.html.BC4JContext;
    import oracle.jbo.ViewObject;
    import oracle.jbo.html.struts11.BC4JUtils;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class LienCheckView1QueryAction extends Action
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    BC4JContext context = BC4JContext.getContext(request);
    // Retrieve the view object instance to work with by name
    ViewObject vo = context.getApplicationModule().findViewObject("LienCheckView1");
    vo.setRangeSize(3);
    vo.setIterMode(ViewObject.ITER_MODE_LAST_PAGE_PARTIAL);
    // Do any additional VO setup here (e.g. setting bind parameter values)
    vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
    // default value for serialCollCd 1 is for Motor Vehicles
    vo.setWhereClauseParam(1,new oracle.jbo.domain.Number(1));
    // Default value for maxRows_allowed
    vo.setWhereClauseParam(2,new oracle.jbo.domain.Number(20));
    return BC4JUtils.getForwardFromContext(context, mapping);
    This doesn't always work properly though. The first time I press the query button, the SerialNum parameter is still null, however if I re-execute the query by pressing the query button again. It will work, and return the rows. I always have to query twice. Also the SerialNum attribute is set to a String in my view object, it is a varchar column in the database, but some serial number I enter give a "Error Message: oracle.jbo.domain.Number ". This happens even though the underlying BC4J is returning values for the query. I also get a "500 Internal Server Error java.lang.ClassCastException: java.lang.String on my View object's code at line 65 which is
    if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
    This is an input paramter to the oracle stored procedure that defaults to a Number value of 1.
    Any idea what the problem is? Here is the full code for my view object:
    package mypackage1;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class LienCheckViewImpl extends ViewObjectImpl
    * This is the PLSQL block that we will execute to retrieve the REF CURSOR
    private static final String SQL =
    "begin pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
    private BigDecimal totalRows = null;
    private String messageCd = null;
    private BigDecimal serialColCd = null;
    private BigDecimal maxRows = null;
    public LienCheckViewImpl() {}
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will *PRECEED* the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params (for example due to a view link)
    * they will be in the 'params' array.
    * We assume that if some parameter is present, that it is a Deptno
    * value to pass as an argument to the stored procedure.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    String serialNumIn = null;
    BigDecimal serialCollCdIn = null;
    BigDecimal maxRowsAllowed = null;
    BigDecimal totalRowsSelected = null;
    String messageCdOut = null;
    if (params != null) {
    if (params.length>0) serialNumIn = (String)params[0];
    if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
    if (params.length>2) maxRowsAllowed = (BigDecimal)params[2];
    storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
    serialCollCdIn,
    maxRowsAllowed));
    super.executeQueryForCollection(qc, params, numUserParams);
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overridden framework method.
    * The role of this method is to "fetch", populate, and return a single row
    * from the datasource by calling createNewRowForCollection() and populating
    * its attributes using populateAttributeForRow().
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    //AddedByRegisNum
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    System.out.println("AddedByRegisNum :" + rs.getBigDecimal(1));
    // OrigRegisNum
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    System.out.println("OrigRegisNum :" + rs.getBigDecimal(2));
    // SerialNum
    populateAttributeForRow(r,2, rs.getString(3));
    System.out.println("SerialNum :" + rs.getString(3));
    // SerialNumDesc
    populateAttributeForRow(r,3, rs.getString(4));
    System.out.println("SerialNumDesc :" + rs.getString(4));
    // FlagExactMatch
    populateAttributeForRow(r,4, rs.getString(5));
    System.out.println("FlagExactMatch :" + rs.getString(5));
    // MessageCd
    populateAttributeForRow(r,5, messageCd);
    // TotalRows
    populateAttributeForRow(r,6, totalRows);
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    * Overridden framework method.
    * Return true if the datasource has at least one more record to fetch.
    protected boolean hasNextForCollection(Object qc) {
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    * Overridden framework method.
    * The framework gives us a chance to clean up any resources related
    * to the datasource when a query collection is done being used.
    protected void releaseUserDataForCollection(Object qc, Object rs) {
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    * Overridden framework method
    * Return the number of rows that would be returned by executing
    * the query implied by the datasource. This gives the developer a
    * chance to perform a fast count of the rows that would be retrieved
    * if all rows were fetched from the database. In the default implementation
    * the framework will perform a SELECT COUNT(*) FROM (...) wrapper query
    * to let the database return the count. This count might only be an estimate
    * depending on how resource-intensive it would be to actually count the rows.
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    Object[] params = viewRowSet.getParameters(true);
    String serialNumIn = (String)params[0];
    BigDecimal serialCollCdIn = (BigDecimal)params[1];
    BigDecimal maxRowsAllowed = (BigDecimal)params[2];
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the fourth bind parameter as our return value of type NUMERIC
    st.registerOutParameter(4,Types.NUMERIC);
    * Set the value of the 3 bind variables to pass as arguments
    if (serialNumIn == null) st.setNull(1, Types.CHAR);
    else st.setString(1,serialNumIn);
    if (serialCollCdIn == null) st.setNull(2,Types.NUMERIC);
    else st.setBigDecimal(2,serialCollCdIn);
    if (maxRowsAllowed == null) st.setNull(3, Types.NUMERIC);
    else st.setBigDecimal(3, maxRowsAllowed);
    st.execute();
    System.out.println("returning value of :" + st.getLong(4));
    return st.getLong(4);
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,
    String serialNum,
    BigDecimal serialColCd,
    BigDecimal maxRows) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Set the value of the bind variables
    System.out.println("SerialNumIn :" + serialNum);
    if (serialNum == null) st.setNull(1,Types.CHAR);
    else st.setString(1,serialNum);
    if (serialColCd == null) st.setNull(2,Types.NUMERIC);
    else st.setBigDecimal(2,serialColCd);
    if (maxRows == null) st.setNull(3,Types.NUMERIC);
    else st.setBigDecimal(3,maxRows);
    st.registerOutParameter(1, Types.CHAR); // serialNum
    st.registerOutParameter(2, Types.NUMERIC); // serialColCd
    st.registerOutParameter(3, Types.NUMERIC); // maxRows
    st.registerOutParameter(4, Types.NUMERIC); // totalRows
    st.registerOutParameter(5, Types.CHAR); // messageCd
    * Register the 6th bind parameter as our return value of type CURSOR
    st.registerOutParameter(6,OracleTypes.CURSOR);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(6);
    serialColCd = st.getBigDecimal(2);
    System.out.println("SerialColCd= " + serialColCd);
    maxRows = st.getBigDecimal(3);
    System.out.println("maxRows= " + maxRows);
    totalRows = st.getBigDecimal(4);
    System.out.println("totalRows= " + totalRows);
    messageCd = st.getString(5);
    System.out.println("messageCd= " + messageCd);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Number
    private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new oracle.jbo.domain.Number(b) : null;
    catch (SQLException s) { }
    return null;
    Natalie

  • How to use a stored procedure as a datasource in Crystal Report for Eclipse

    Hi All,
    I've written a stored procedure in oracle 10g with few input parameters and one refcursor output parameter. I want to use this stored procedure as a data source for creating a report in "Crystal Report For Eclipse 3.6.0".
    When I tried to add this stored procedure to the report using the connection explorer, I don't see any option to do this. But when I try to add any table, it shows options like "Add to the current report"....
    Can anybody assist me how to use a stored procedure as a data source in "Crystal Report For Eclipse"?
    Which driver should I use to connect to the oracle database? I tried using JDBC Driver for Oracle.
    Thanks in advance.

    Did you solve your problem? How did you do?

  • Column used in stored procedure

    i want to pass table name and column name as a paramter .
    is it possible to get which procedure using the column

    898343 wrote:
    i want to pass table name and column name as a paramter .
    is it possible to get which procedure using the columnIt is possible to pass in table and column names as arguments.
    BluShadow and SomeoneElse pointed out that it is Probably Not a Good Idea unless you are exploring the limits of SQL and PL/SQL - that is, learning.
    You will probably have to use DBMS_SQL for this kind of work, which is labor-intensive and tedious. You will have to manually build the SQL as text (syntactically correct!), manually set up the data interfaces, perform extensive error handling, and test the application carefully. Most of the work you will have to perform manually is automatically done for you by the usual cursor definition and open/fetch/close functionality in normal PL/SQL which is usually more efficient anyway.
    There are advanced applications for this techique (extensible indexing, for instance) but the complexity and difficulty of maintenance make dynamic SQL a difficult solution to implement and maintain.
    You should be able to find examples of dynamic SQL online, perhaps here on OTN or perhaps MOS if y ou have an account. Learn why BluShadow, SomeoneElse, and I are advising caution for yourself :)
    Good luck

  • Doubt: Problem in enqueing using DBMS_AQ.enqueue procedure

    Hello All,
    I have one issue with Oracle AQ. One of our implementation requires us to extract data from the tables and enqueue the extracted data into an Oracle AQ.
    I will try to explain my problem as briefly as possible:
    1. We have created a queue of type CLOB using the following procedure
    begin
    dbms_aqadm.create_queue_table('BOD36_3PLB2B_TABLE', 'IKN_CLOB'); -- IKN_CLOB—This is CLOB custom type that we have created to have CLOB data.
    dbms_aqadm.create_queue('BOD36_3PLB2B_Q', 'BOD36_3PLB2B_TABLE');
    dbms_aqadm.start_queue('BOD36_3PLB2B_Q');
    end;
    The queue creation was successful.
    2. Then we have developed a package to extract data from the database into a VARRAY and then using the varray as the payload.
    3. In the package we are calling the following code to enqueue data into the database with the VARRAY as the payload
    dbms_aq.enqueue(queue_name => ikn_qname,
    enqueue_options => lt_enqueue_options,
    message_properties => lt_message_properties,
    payload => p_SHOWPL_ARR_OUT, ---> p_SHOWPL_ARR_OUT it is the varray to which we are putting the data to enqueue
    msgid => messageid);
    4. When I compile the package, I get the error: PLS-00306: wrong number or types of arguments in call to 'ENQUEUE'.
    If you have faced similar issues and have any pointers to the above, then please help!! I am not sure where i have gone wrong.
    Please help !!!!!
    Thanks in advance and thanks for your patience.
    Regards,
    Dibya

    The package has another function enqueue_array. Maybe that will help you. Check it out from the Oracle docs.
    Ben

  • How to use a atore procedure in the sender Jdbc adapter

    Hi Experts!
    I am having a requirement to read multiple data from multiple tables from Oracle database at a time.
    In sender side i am using JDBC Adapter. Here i want to know how can we use a store procedure to do this and can any one pls give a blog which guide me in design.
    Thanks in advance,
    Preethi.

    Pleasae see this thread
    Stored procedure in Sender JDBC Adapter
    In space of select statement put
    EXEC nameofstoredprocedure
    and update statement
    Put <TEST>

  • ORA-29855 - Error creating Spatial Index using a Stored Procedure

    Hi
    I am using Oracle 10gR2 database and I have written a stored procedure to create spatial index. But when i execute this function i get the following error message.
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Error in R-tree: [mdrcrtscrt]
    ORA-13231: failed to create index table [MDRT_217C1$] during R-tree creation
    ORA-13249: Stmt-Execute Failure: CREATE TABLE FGDABZ40.MDRT_217C1$ (NODE_ID NUMBER, NODE_LEVEL NUMBER, INFO BLOB) LOB (INFO) STORE AS (CACHE) NOLOGGING PCTFREE 2
    ORA-29400: data cartridge error
    ORA-01031: insufficient privileges
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
    ORA-06512: at line 1
    ORA-06512: at "FGDABZ40.PKG_PSSDBE_APPLICATION", line 298
    ORA-06512: at line 17
    The tables that i am passing are registered in metadata and I am able to create indexes directly in sql plus. But when i try to create using this stored procedure, it fails.
    it should be possible to create indexes using a generic function. Has any faced a similar problem?
    regards
    sam

    Hi,
    I am having a same error on Oracle 10gR2 database. When I execute the same statement in sqlplus, it works. But it gives this error when I call the procedure which has this create spatial index statement.
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Error in R-tree: [mdrcrtscrt]
    ORA-13231: failed to create index table [MDRT_20CDA$] during R-tree creation
    ORA-13249: Stmt-Execute Failure: CREATE TABLE "SDOMGR".MDRT_20CDA$ (NODE_ID NUMBER, NODE_LEVEL NUMBER, INFO BLOB) LOB (INFO) STORE AS (CACHE) NOLOGGING PCTFREE 2
    ORA-29400: data cartridge error
    ORA-01031: i
    Any help will be appreciated.
    Thanks,
    Sri

Maybe you are looking for

  • Why doesn't my Finder search work?

    Wanted to perform a search of text content in some PDFs. There are, say, 30 x 5-20 page PDFs sitting in a couple of folders, on a server I'm connected to. In Finder, I hit Apple F and then asked it to search the root folder those folders were sitting

  • How to display the user in a Portal page?

    This is certainly a qyestion many of you have come across: What is the best way to display the portal username in a portal page? Thanks in advance for your help, Miguel

  • MICR font not displayed in PDF on SUSE Linux Server for Check Writer (XML)

    We are generating checks by running the Check Writer(XML) concurrent request and are not able to see MICR fonts on the Check. We downloaded the free version from IDAutomationSMICR.ttf and the fonts were registered under /usr/local/fonts/micr director

  • Auxiliary filename conflict - duplicate command

    Hi, We want to duplicate our production database (repos) from machine wmd-portal to auxiliary database (reposdup) of machine vmcdemo6. Following are the command and error message: Command: RMAN> duplicate target database to reposdup; Error message: R

  • Java.io.IOException: Interrupt sysstem call

    When I stop my program with CTRL+C, I got a IOException like this: java.io.IOException: Interrupt sysstem call How can I catch it?