Getting the ROWID of a Row

I'm trying to develop a generic OCI class which is also capable
of inserting, updating and deleting records.
Is there an OCI function which gets the ROWID of a returned row
without having to explicitly specify it in the SELECT clause of
the query ? At present the fields that make up the primary key
or unique index have to be specified in the SELECT.
Does anyone know how the OO4O Class Library gets round this
problem ?
Upto now I have been using OO4O but now wish to migrate to OCI
for compatibility reasons.

If it is a SELECT for UPDATE, the ROWID is implicitly returned .
It can be retrieved by calling OCIAttrGet on the statment handle.

Similar Messages

  • Getting the ROWIDs of non-duplicate rows in Oracle 10g

    Hi,
    given a table TAB1 in which the primary key is composed of these first 3 columns:
    ================================================
    colA____________colB_________________colC____________________colD
    ================================================
    AA-----------------------01-----------------------20080101-----------------------100
    BX-----------------------32-----------------------20050325-----------------------366
    AA-----------------------01-----------------------20080102-----------------------645
    AA-----------------------01-----------------------20080707-----------------------765
    AB-----------------------02-----------------------20080806-----------------------336
    AB-----------------------02-----------------------20080705-----------------------543
    I wish to be able to find the ROWIDs of those rows where colA||colB occurs only once in the table TAB1.
    So in the above example, I would want to know the ROWID of the row containing colA=BX and colB=32 as "BX32" occurs only once in this table (AA01 occurs 3 times, AB02 occurs twice so I'm not interested in them).
    The following does work, but it is too SLOW:
    select ROWID from TAB1 where colA||colB = (select colA||colB from TAB1 HAVING COUNT(*)=1)
    Can anyone please suggest an efficient way to find this unique ROWID value in these circumstances?
    Edited by: Nemesis on Nov 29, 2008 2:50 AM

    Thank you Walter.
    This does not give the desired result however. It compares the table, row by row with a 'mirror' of itself and says 'give me the rowid of the row where its mirror does not match itself' (correct me if I am wrong)
    (Here I added the '=' to ' AND d.ROWID = d1.ROWID);'
    SELECT D.rowid
    FROM TAB1 D
    WHERE NOT EXISTS (SELECT *
    FROM TAB1 d1
    WHERE d1.COLA = d.COLA
    AND d1.COLB = d.COLB
    AND d.ROWID = d1.ROWID);
    So it returns nothing as all rows match their mirror rows.
    However, it gave me the idea of doing the following:
    SELECT D.ROWID FROM TAB1 D WHERE (SELECT COUNT(*) FROM TAB1 D1 WHERE X.colA = D.colA AND X.colB = D.colB )=1;
    Which works, and seems a little faster than my original query, so thank you for this.

  • Get the Count for each row

    I'm trying to get the count for each row to total count for each month
    Something like this
    Hardware     |      Jan
    Monitors       |       5
    Processors   |      137
    Printers        |      57
    etc........
    How can I write a query for this. I can get the Hardware column but don't know how to get the next column.

    If you can provide more data like sample input DML statements it would have been wonderful..
    Assuming is , you need a pivot. Here is an article on basic Pivot..
    http://sqlsaga.com/sql-server/how-to-use-pivot-to-transform-rows-into-columns-in-sql-server/
    something like this may be..
    DECLARE @Input TABLE
    Hardware VARCHAR(20),
    [Date] VARCHAR(20)
    INSERT INTO @Input VALUES('Monitor', '01/01/2014'), ('CPU', '01/01/2014'), ('Monitor', '01/03/2014')
    , ('ABC', '01/01/2014'),('Monitor', '02/01/2014')
    ;WITH CTE AS
    SELECT Hardware, LEFT(DATENAME(M, [Date]),3) AS [MonthName] FROM @Input
    SELECT *
    FROM
    SELECT Hardware, [MonthName], COUNT(Hardware) AS Count FROM CTE GROUP BY Hardware, [MonthName]) a
    PIVOT (MAX([Count]) FOR [MonthName] IN ([Jan], [Feb])) pvt
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • How to get the index of a row in dynamically generated list

    Hi,
    I am displaying a list which contains 6 rows using <logic:iterator/>
    If i am changing a text value which is in 3 row, I want to pass that row index to the javascript function.
    I am using IndexId attribute of <logic:iterator> to get the index of a row,but
    It is working fine for Hyperlink buttons, but it is no working for text boxes.
    can any one plz help me..
    Thanks,
    madhu

    madhu,
    Please post your code... It's a bit like asking a mechanic to fix your car blind folded.

  • How to get the RowID in a VO

    Hi All,
    I have a expert mode VO. Its not a EO based VO. I need the row id in the VO query. But it throws me an ora-01445 error. I need the rowid because I need to pass it as a parameter to a procedure. How can i get this done. Any help is greatly appreciated.
    Thanks,
    Sreeram.

    HI,
    This is my sql query in the VO I am trying to develop:
    SELECT * from (SELECT aid.rowid,
    aid. ACCOUNTING_DATE,
    aid. DISTRIBUTION_LINE_NUMBER,
    aid. INVOICE_ID,
    aid. ACCRUAL_POSTED_FLAG,
    aid. ASSETS_ADDITION_FLAG,
    aid. ASSETS_TRACKING_FLAG,
    aid. CASH_POSTED_FLAG,
    aid. DIST_CODE_COMBINATION_ID,
    aid. LAST_UPDATED_BY,
    aid. LAST_UPDATE_DATE,
    aid. LINE_TYPE_LOOKUP_CODE,
    aid. PERIOD_NAME,
    aid. SET_OF_BOOKS_ID,
    aid. INVOICE_DISTRIBUTION_ID,
    aid. AMOUNT,
    g.code_combination_id,
    g.segment1,
    g.segment2,
    g.segment3,
    g.segment4,
    g.segment5,
    g.segment6,
    ppa.segment1 as Project,
    pt.task_number as TASK,
    aid.expenditure_type,
    aid.expenditure_item_date,
    hao.name as name
    FROM AP.AP_INVOICE_DISTRIBUTIONS_ALL aid,
    GL.GL_CODE_COMBINATIONS g,PA.pa_projects_all ppa, PA.pa_tasks pt, apps.hr_all_organization_units_tl hao
    WHERE aid. invoice_id = 19498
    AND LINE_TYPE_LOOKUP_CODE in ('ITEM')
    AND aid. DIST_CODE_COMBINATION_ID =g.code_combination_id
    AND aid.project_id = ppa.project_id(+)
    AND aid.task_id = pt.task_id (+)
    AND aid.expenditure_organization_id = hao.organization_id (+)) QRSLT where 1=2
    But it gives me this error:
    SQL QUERY ERROR MESSAGE:ORA-01445 Cannot select rowid from, or sample a join view with out a key-preserved table.
    Btw..this is a custom application.
    Any pointers on this..
    Thanks,
    Sreeram.
    Edited by: SreeramKosaraju on Jun 29, 2009 9:58 AM

  • How to get the ROWID in a Trigger?

    On Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit when I try below script I always get the same Rowid as "AAAAAAAAAAAAAAAAAA". Is this normal?
    Thank you.
    create table testrowid (a number );
    create or replace trigger testrowidbins
    before insert on testrowid for each row
    begin
    dbms_output.put_line( 'Rowid:= ' || :new.rowid );
    end;
    set serveroutput on
    insert into testrowid values( 1 );
    insert into testrowid values( 2 );
    insert into testrowid values( 3 );
    rollback ;
    insert into testrowid values( 1 );
    insert into testrowid values( 2 );
    insert into testrowid values( 3 );
    commit ;
    insert into testrowid values( 1 );
    insert into testrowid values( 2 );
    insert into testrowid values( 3 );
    rollback ;

    Well, it was more of a rhetorical question.
    Rowid is the physical location of a row in a table. During the execution of a BEFORE trigger, the row has not yet been placed in the table hence the 'AAAAA' rowid.
    During your AFTER trigger, the row exists in the table and therefore has a normal rowid.

  • How to get the values of all rows in advanced table

    HI All,
    I am using an advanced table to enter the values for the service contract line (its a custom page)in that advanced table i ahave column with lov called task number for that task number once i had choosed one task number and creating one more row using add anethor row button i want to restrict the user to not to choose the task number which was entered in the previus row.
    Or if this is not possible i want to restrict the user by showing an error message when click on the submit button by saying you have choosed the duplicate task number please choose a uniqu task number
    please give some hints
    thanks
    ajay

    Hi
    your approach will have two steps
    1.) use the row refernce and get the value of task number of the row which is enterd by user .
    2.) use getRows in range and compare values of task number of every row with the user selected value ,if value match then throw error.
    Thanks
    Pratap

  • How to get the index of table row without selection?

    Hi all,
    I have an table designed in XML view.Now i have added an change method for qty cell "valqty". When user inputs the qty in the cell and press enter this method is triggered now I want to know which index of the table is currently edited.Through which i can get the value of other cell in the same row.
    NOTE: The table row doesn't have selection either multiple or single
    I tried the following inside the valqty method but it now working
    this.getValue();
    this.getBindingContext().getProperty('PRD_NUM');
    <Table id="idProductsTable"
    inset="false"
    items="{oModel>/deliverylist}"
    visibleRowCount= "7"
    mode="MultiSelect"
    modeAnimationOn="true">
    <headerToolbar>
    <Toolbar>
    <Label text="Products"></Label>
    </Toolbar>
    </headerToolbar>
    <columns>
    <Column
    minScreenWidth="Tablet"
    demandPopin="true">
    <Text text="Order" />
    </Column>
    <Column
    minScreenWidth="Tablet"
    demandPopin="true">
    <Text text="Quantity" />
    </Column>
    </columns>
    <items>
    <ColumnListItem>
    <cells>
    <Text text="{oModel>PRD_NUM}" />
    <Input value="{oModel>DEL_QUAN}" change="valqty" maxLength="13"  />
    </cells>
    </ColumnListItem>
    </items>
    </Table>
    Thanks

    Thanks Robin,
    But in my case oEvent.getSource() is returning the cell instance and
    oEvent.getSource().getBindingContext() is undefined
    Hence not getting the value
    I also tried the following
    oEvent.getSource().getParent().getParent().indexOfItem()
    But index returned is -1

  • How do I get the rowid or the DataModel from a DataTable inside a DataTable

    Hi,
    I have a simple application which I cannot get to work.
    I have two entity classes: Parent and Child.
    I want to create a page which lists all of the Parents, and in a column of the Parent row has an inner dataTable which displays the Children of the Parent. I then want to click on the Child and link to a view of that Child. What is happening is that I cannot resolve which child was clicked inside my row. I don't seem to be able to get the datamodel for the List children, so it always defaults to the first child in the list.
    Goal: drill down to a specific child from a list of parents with a sublist of children belonging to each parent.
    I have tried creating a new method called prepareChildView() in ParentController like this below but it always returns the first child. I figure I need to create the DataModel earlier but cannot figure out how to do this. Perhaps the auto generated pattern makes it difficult to achieve what I want to - not sure.
    public String prepareChildView() {
            current = (Parent)getItems().getRowData();
            DataModel d = new ListDataModel(current.getChildren());
            Child child = (Child)d.getRowData();
            //child is always the first child!
            return "\children\View";
        }I may be going about this completely wrong so am open to suggestions. I am using JSF2, Glassfish3.0.
    Parent.java
    @Entity
    public class Parent implements Serializable {
        @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
        private List<Child> children;
        public List<Child> getChildren() {
            return children;
        public void setChildren(List<Child> children) {
            this.children = children;
    }Child.java
    @Entity
    public class Child implements Serializable {
        @ManyToOne
        @JoinColumn(name = "parent")
        private Parent parent;
        public Parent getParent() {
            return parent;
        public void setParent(Parent parent) {
            this.parent = parent;
    }ParentFacade and ChildFacade are auto generated from NetBeans, as are ParentController and ChildController.
    ParentController:
    Code doen't fit in the post.
    List.xhtml
    <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListParentEmpty}" rendered="#{parentController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{parentController.items.rowCount > 0}">
                    <h:outputText value="#{parentController.pagination.pageFirstItem + 1}..#{parentController.pagination.pageLastItem + 1}/#{parentController.pagination.itemsCount}"/> 
                    <h:commandLink action="#{parentController.previous}" value="#{bundle.Previous} #{parentController.pagination.pageSize}" rendered="#{parentController.pagination.hasPreviousPage}"/> 
                    <h:commandLink action="#{parentController.next}" value="#{bundle.Next} #{parentController.pagination.pageSize}" rendered="#{parentController.pagination.hasNextPage}"/> 
                    <h:dataTable value="#{parentController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Id"/>
                            </f:facet>
                            <h:outputText value="#{item.id}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Name"/>
                            </f:facet>
                            <h:outputText value="#{item.name}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Children" />
                            </f:facet>
                            <h:dataTable value="#{item.children}" var="child" >
                                <h:column>
                                    <h:commandLink action="#{parentController.prepareView}" value="#{child.name}" />
                                </h:column>
                            </h:dataTable>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value=" "/>
                            </f:facet>
                            <h:commandLink action="#{parentController.prepareView}" value="#{bundle.ListParentViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{parentController.prepareEdit}" value="#{bundle.ListParentEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{parentController.destroy}" value="#{bundle.ListParentDestroyLink}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{parentController.prepareCreate}" value="#{bundle.ListParentCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListParentIndexLink}" action="/index" immediate="true" />
            </h:form>

    Hi,
    It will help to resolve your issue:
        public String processChildView(){
            UIComponent component = null;
            String  componentId = null;
            Parent parent = null; //Bean class
            Child child = null; //Bean Class
            FacesContext context = FacesContext.getCurrentInstance();
            UIViewRoot root = context.getViewRoot();
            String childView = "childView";
            //Parent Table UIData
            componentId = "parentChildTable";
            component = findComponent(root, componentId);               
            UIData parentTable = (UIData) component;
            //Child Table UIData
            componentId = "childTable";
            component = findComponent(root, componentId);               
            UIData childTable = (UIData) component;
            //Perform Parent Child operation
            if(parentTable != null && childTable != null){
                if(parentTable.getRowData() instanceof Parent){
                    //Get Parent Object from parentTable
                    parent = (Parent) parentTable.getRowData();
                    //Get child object by parent object using childTable's Row Index
                    parent = (Parent) parentTable.getRowData();
                    child = (Child) parent.getChild().get(childTable.getRowIndex());
                    System.out.println("Parent Name " + parent.getName() + "Child Name " + child.getName());
            return childView;
        //Utility method to get component by passing component id in requested view
        public static UIComponent findComponent(UIComponent c, String id) {
             if (id.equals(c.getId())) {
               return c;
             Iterator kids = c.getFacetsAndChildren();
             while (kids.hasNext()) {
               UIComponent found = (UIComponent) findComponent((UIComponent)kids.next(), id);
               if (found != null) {
                 return found;
             return null;
      } Regards,
    Manish Paliwal
    "Life is beautifull."

  • How to get the rowid and the entire record selected in PLSQL?

    The code given below does not work.
    You cannot select the record and the rowid using a cursor in one-shot.
    But you could do that in a direct SELECT in "SQL Plus" when you select records for display. Is this a bug in ORACLE PLSQL? Or is there another way to do this?
    DECLARE
    objid_ VARCHAR2(200);
    rec_ xxx_tab%ROWTYPE;
    CURSOR get_rec IS
    SELECT t.*, t.rowid
    FROM xxx_tab t;
    BEGIN
    OPEN get_rec;
    FETCH get_rec INTO rec_, objid_;
    CLOSE get_rec;
    END;
    -----------------------------------

    You cannot fetch into both a record type and a variable. You have a few options, you can declare the record a s a rowtype of the cursor like this:
    DECLARE
       CURSOR c IS
          SELECT t.*, rowid rid
          FROM t;
       l_rec c%ROWTYPE;
    BEGIN
       OPEN c;
       FETCH c INTO l_rec;
       CLOSE c;
    END;You could use an implicit cursor and let Oracle deal with the record type internally (not to mention the open fetch and close) like this:
    BEGIN
       FOR rec in (SELECT t.*, rowid rid FROM t) LOOP
          do_stuff with rec.col_name
       END LOOP;
    END;Note that in both of these you must alias the rowid column to some other name, you could also manually construct the record type to match the table and add a column od ROWID datatype to hold the rowid.
    Finally, I think, depending on what you are actually going to do with the rowid, and how you feel about having records locked, you could look at declaring the cursor as FOR UPDATE and get rhe rowid for free.. This would be most appropriate if you are planning to update the table in the cursor (a bad practce by the way). Something like:
    DECLARE
       l_rec t%ROWTYPE;
       CURSOR c IS
          SELECT t.*, rowid
          FROM t;
    BEGIN
       OPEN c;
       FETCH c INTO l_rec;
       do_whatever with l_rec
       UPDATE t
       SET whatever
       WHERE current of c;
    END;John

  • How to get the total number of rows in result set?

    Using JDBC and mysql

    There is no method to directly obtain the count of the resultset.
    int count = 0;
    while( rs.next() )
        count++;
    }Another way,
    Use a [Scrollable ResultSet|http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html]
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    //Get the resultset
    rs.last();
    rs.getRow();

  • How to get the measure total at row level for another measure calculation in DAX?

    Hi There,
    Using DAX, I am trying to get an expression for a calculated measure as follow:
    So basically, I would like to get the AMeasure total highlighted in yellow in the A2Measure calculation:
    Smeasure -(Ameasure total * WMeasure) where Ameasure total is the one highlighted. 
    I think my question would be how to get the total of a measure in order to used in the calculation of another measure.
    Thanks and best regards,
    Joss

    Hi Joss83,
    If you're trying to get the result for [AMeasure] at the total level (i.e. 5.09 in your example) you can do this by creating a version of this measures that is evaluated after ignoring the filters (indirectly or explicitly) placed on
    the 'Customer' and 'Player' columns. You may also need to ignore the filters place on some other tables or columns that must be ignored in order for the correct total to be returned.
    Without knowing much more about your data model, I can only take a vague guess as to what this calculation would look like in your scenario:
    AMeasureTotal:=
    CALCULATE(
    [AMeasure],
    ALL(Customer[Customer]),
    ALL(Player[Player])
    You can read more about the 'ALL' DAX function here:
    http://technet.microsoft.com/en-us/library/ee634802.aspx
    Hope this helps,
    Michael

  • How to get the class from selected row in af:table

    I know that you can get individual selcted row values from an af:table using getRow().getAttribute("attName").
    But, can I obtain the class that the table iterator used to populate the table?
    For instance, a table lists the result of an employee search that was bound to a session bean method returning List<Employee>.
    After selecting the employee of interest and clicking a command button I want to access that instance of the Employee class to pass onto the session bean to do some stuff.
    I don't want to hit the database to do it either (via a query on a key value for example) - the search iterator has already retrieved it, I just want to access it and do something with it.
    Possible?
    Thanks.

    Hi,
    if you use ADF try iterator.getCurrentRow().getDataProvider() on the binding container. If you use ADF Faces without then the Row object is the instance of your class
    Frank

  • How to get the first or last row value from a group using ntile

    I want to query and use ntile to divide by data in 4 groups (quartiles). I got this part no problem and it returns the list of rows and the ntile bucket value for each one.
    What I want though is to get only the first row from each ntile group (so in effect the max, q3, median, q1 and min values from the whole result). Of course I coud get max, min and median directly using the other functions, but how about the values for q3 and q1?
    My query contains this:
    NTILE(4) OVER (ORDER BY salary DESC NULLS LAST) as ntile
    So I want the highest, lowest, middle, q3 and q1 values for the salaries.
    Should I be using NTILE, ROWNUM, PERCENTIL_DIST....?
    Any ideas? Thanks in advance.

    SQL> select ename,sal,
      2  NTILE(4) OVER (ORDER BY sal DESC NULLS LAST) as ntile
      3  from emp
      4  /
    ENAME             SAL      NTILE
    KING             5000          1
    FORD             3000          1
    SCOTT            3000          1
    JONES            2975          1
    BLAKE            2850          2
    CLARK            2450          2
    ALLEN            1600          2
    TURNER           1500          2
    MILLER           1300          3
    WARD             1250          3
    MARTIN           1250          3
    ENAME             SAL      NTILE
    ADAMS            1100          4
    JAMES             950          4
    SMITH             800          4
    14 rows selected.
    SQL> select  ename,
      2          sal
      3    from  (
      4           select  ename,
      5                   sal,
      6                   ROW_NUMBER() OVER (PARTITION BY ntile ORDER BY sal DESC NULLS LAST) as rn
      7             from  (
      8                    select  ename,
      9                            sal,
    10                            NTILE(4) OVER (ORDER BY sal DESC NULLS LAST) as ntile
    11                      from  emp
    12                   )
    13          )
    14    where rn = 1
    15  /
    ENAME             SAL
    KING             5000
    BLAKE            2850
    MILLER           1300
    ADAMS            1100
    SQL> SY.

  • Using DBMS_APPLICATION_INFO.SET_MODULE to get the number of updated rows.

    hi.
    i have 2 tables to sync so i use the following code. however i included DBMS_APPLICATION_INFO.SET_MODULE to track the number of rows to be updated, but its not showing in v$sessions view. can anyone tell me what am i missing over here ?
    DECLARE
    l_count NUMBER (20, 0) := 0;
    l_updates NUMBER (20, 0) := 0;
    l_inserts NUMBER (20, 0) := 0;
    BEGIN
    FOR i
    IN (SELECT date_value,
    book_id,
    amount
    FROM bookstore.book_master_transit)
    LOOP
    BEGIN
    UPDATE bookstore.book_master
    SET amount = i.amount
    WHERE date_value = i.date_value
    AND book_id = i.book_id;
    IF (sql%ROWCOUNT > 0)
    THEN
    BEGIN
    l_updates := l_updates + 1;
    END;
    ELSIF (sql%ROWCOUNT = 0)
    THEN
    BEGIN
    INSERT INTO bookstore.book_master (     date_value, book_id, amount)
    VALUES (i.date_value, i.book_id, i.amount);
    l_inserts := l_inserts + 1;
    END;
    END IF;
    l_count := l_count + 1;
    DBMS_APPLICATION_INFO.set_module ('sync_book_info','total = '|| l_count|| '; updates = '|| l_updates|| '; inserts = '|| l_inserts);
    IF (MOD (l_count, 1000) = 0)
    THEN
    COMMIT;
    END IF;
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    END LOOP;
    COMMIT;
    END;
    when i query v$sessions after running this i couldnt find any entry with the value 'sync_book_info' as the module name. please advice me what i am doin wrong and how to do it right..
    thanks in advance,
    noviceDBA

    novicedba wrote:
    hi.
    i have 2 tables to sync so i use the following code. however i included DBMS_APPLICATION_INFO.SET_MODULE to track the number of rows to be updated, but its not showing in v$sessions view. can anyone tell me what am i missing over here ?
    DECLARE
    l_count NUMBER (20, 0) := 0;
    l_updates NUMBER (20, 0) := 0;
    l_inserts NUMBER (20, 0) := 0;
    BEGIN
    FOR i
    IN (SELECT date_value,
    book_id,
    amount
    FROM bookstore.book_master_transit)
    LOOP
    BEGIN
    UPDATE bookstore.book_master
    SET amount = i.amount
    WHERE date_value = i.date_value
    AND book_id = i.book_id;
    IF (sql%ROWCOUNT > 0)
    THEN
    BEGIN
    l_updates := l_updates + 1;
    END;
    ELSIF (sql%ROWCOUNT = 0)
    THEN
    BEGIN
    INSERT INTO bookstore.book_master (     date_value, book_id, amount)
    VALUES (i.date_value, i.book_id, i.amount);
    l_inserts := l_inserts + 1;
    END;
    END IF;
    l_count := l_count + 1;
    DBMS_APPLICATION_INFO.set_module ('sync_book_info','total = '|| l_count|| '; updates = '|| l_updates|| '; inserts = '|| l_inserts);
    IF (MOD (l_count, 1000) = 0)
    THEN
    COMMIT;
    END IF;
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    END LOOP;
    COMMIT;
    END;
    when i query v$sessions after running this i couldnt find any entry with the value 'sync_book_info' as the module name. please advice me what i am doin wrong and how to do it right..
    Totally, 100%, remove & eliminate entire EXCEPTION handler.
    Then you will be able to see error being RAISED; like No Privs

Maybe you are looking for

  • Upgraded from 10.5 to 10.6. IP Printing not working?

    Hello, I recently upgraded from 10.5 to 10.6 Snow Leopard and as I knew, our Appletalk Printers no longer showed up. I knew this would be the case and tried adding the printers via IP. I've printed out the spec sheets from the printers to obtain the

  • Dreamweaver CS4 Help is LIVE!!

    HI gang, We have posted DW CS4 help in its complete and almost impeccable form: http://help.adobe.com/en_US/Dreamweaver/10.0_Using/ Well, yes, it is actually far from impeccable. If you see a problem, do let me know. The new features, with links to t

  • Transport Layer

    Hi guyz, I have a question. why do we need a transport layer between the Development system and the consolidation system?? It is really appreciated if someone can throw some light on "Transport Layer". Thanx in advance. Ashok

  • OraLink is NOT WORKING.I CANNOT believe a simple issue is such a pain 2 FIX

    I dont know why it has to be so much complicated over the hover event in CSS skinning. It is not that I have not tried enough. I have extensively searched over the web, oracle forums and metalink but just can not find the reference to hover mechanism

  • Illustrator cs5 portable shuts down after I save a file

    I have illustrator cs5 that worked just fine on my old pc. I am using it now on my new pc (win 7, 64 bit, 8GB Ram, i5 3.40GHz) but every time I try to save a file no matter how small, illustrator shuts down completely. Someone help please.