Deleting rows in a table T1, when last row in table T2 is deleted

I have two tables, T1 and T2. The relation of T1 to T2 is one to many.
If the last row of T2 is deleted, the correspondig record in T1 should also be deleted.
How can I implement this in the delete-trigger of T2.
Thanks
null

I have two tables, T1 and T2. The relation of T1 to T2 is one to many.
If the last row of T2 is deleted, the correspondig record in T1 should also be deleted.
How can I implement this in the delete-trigger of T2.
Thanks
null

Similar Messages

  • Dynamic tables collide when adding rows

    Hi,
    I created two dynamic tables with buttons to add/remove/move rows. When I add rows, the table collides with the other one and overlays it. How can I manage that the other table (or content) of the PDF is moved automatically further down to avoid a collision?
    Thanks
    Using LCD 7.1
    Edited by: Martin Hornstein on Jul 2, 2008 2:52 PM

    Hi,
    first of all thanks for answering that quickly!
    @ Gopal
    Thank you. When I wrap the whole page with a subform and set it to flowed, all elements are in a chaos (but the table is flowed to the next page when reaching the end of it).Putting a subform between the two tables works!
    Space between two tables:
    subform (flowed)
    --> subform (flowed)
    >table
    --> subform (position) = spacer
    --> subform (flowed)
    >table
    @ amita
    unfortunately it is not possible to check that option for allowing page breaks
    Thanks to both of you!
    Edited by: Martin Hornstein on Jul 4, 2008 2:35 PM
    Edited by: Martin Hornstein on Jul 4, 2008 2:36 PM

  • I want to create a mail merge for address labels into a table, but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address.

    ...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
    Thanks!

    That is a quirk of Pagesthat  it applies only one record per page.
    There is a way around this:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
    Peter

  • Selected rows appear in random order when selected from ADF Table

    Hi All,
    I am working in ADF 10.1.3
    I have a ADF Table with a multi select option associated with a DataBean, My requirement is when I select multiple rows from the table and click on some button to goto next page, the selected rows are not getting populated as per the selection order.
    Example: If I select 1st,3rd,5th,7th,9th rows from the ADF Table then in the next page I see the results as 3rd,1st,5th,9th,7th. - Randomly it is getting displayed.
    I am using the following code to get the records from Multi select ADF Table.
    I am adding the selected records to a List.
    selectedRowSet = this.getTable1().getSelectionState().getKeySet();
    rowSetIter = selectedRowSet.iterator();
    if (selectedRowSet.size() > 0)
    Integer index = Integer.parseInt((String) rowSetIter.next());
    Object rowData = this.getTable1().getRowData(index.intValue());
    The order is getting jumbled when I see the final list.
    Pls help me in this.
    Thanks

    Hi Frank,
    Thanks for the update.
    We are using 10.1.3.3 and already our application in QA Testing. User need this to be fixed. Is there any work around for this problem?
    Thanks
    JP

  • Invalid table name when pass in the table name as variable in dynamic sql

    Hi,
    I need to create a stored procedure which will return a list of data to my java application like the following.
    first, select the table name from the first table.
    For example : SELECT T_NAME FROM MDR_SMSTABLES
    second, select the data from the table which returned by first select statement
    For example : SELECT * FROM T_NAME.
    I use dynamic sql with cursor to select the data. But it returns "java.sql.SQLException: ORA-00903: invalid table name"
    I fetch the table name to varchar2. I think this might the cause it returns me the this error. But i don't know what type should i put for the table name other then varchar2.
    val2 VARCHAR2(200);
    OPEN cv FOR
    SELECT T_NAME FROM MDR_SMSTABLES WHERE T_DATE=d_dt_sent;
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR
    'SELECT * FROM :t WHERE MID = :m' USING val2, msg_id;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    As my stored procedure is quite long, so i just paste some of the code here. Hope the information is enough. Can anyone please help?
    Thanks

    DECLARE
    val2 VARCHAR2 (200);
    cv sys_refcursor;
    refcur sys_refcursor;
    BEGIN
    OPEN cv FOR
    SELECT table_name
    FROM user_tables
    WHERE table_name IN ('EMP', 'DEPT');
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR 'SELECT * FROM '||val2;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    END;

  • In windows 8.1 when using thunderbird, I can't delete an email in the inbox when a write screen is open. Delete works when no write is open. Any ideas?

    Using Thunderbird 31.5.0. Windows 8.1 (unfortunate garbage version)

    Mark them as Junk and Thunderbird will gradually learn what is and isn't "spam" (it prefers the term "Junk") and will start sorting them automatically.
    You are indeed experiencing abnormally high levels of spam. Any thoughts on why? You do need to be selective about where you post your email address, and it helps to have multiple email addresses which you can use for different purposes. Also, never unsubscribe from unsolicited email messages. Just delete them.

  • In Pages I was deleting a section of text and when I lifted my finger off the delete button the computer just kept deleting until I pressed the button again. What did I do? Is there a keyboard shortcut to continuously delete without pressing delete?

    I believe i may have pressed some sort of kepboard shortcut that made this happen.

    While I am sorry this happened to you, I am beyond glad to know that this happened to someone else. I was typing my Graduate thesis when this happened to me! Lost a lot of work and learned a very valuable lesson about auto save and multiple copies! I called Microsoft about this, the woman I spoke with claimed I was the first one she had ever heard of having this issue...blamed it on Apple, said it was likely some key stroke? Kinda would like to know how I did it, so I NEVER do it again.  And the button was not stuck!

  • Delete Last Row in Matrix on SBO 2005

    Hi,
    Im using SAPB1 2005 SP1 with B1DE.
    I've seen a post that indicates that the following code should delete a row from a matrix (even the last row) when using SBO 2005
    I still find that all rows except last row of matrix are removed from the database.
    <b>How do I delete the last row from the Del button event handler????</b>
    I'm using
    <i>        [B1Listener(BoEventTypes.et_CLICK, false)]
            public virtual void OnAfterClick(ItemEvent pVal)
                bool ActionSuccess = pVal.ActionSuccess;
                Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
                Item item = form.Items.Item("del");
                Button button = ((Button)(item.Specific));
                // ADD YOUR ACTION CODE HERE ...
                int row;
                Matrix oMtx = (Matrix)form.Items.Item("mtx_0").Specific;
                DBDataSource oDBDS = (DBDataSource)form.DataSources.DBDataSources.Item("@SD_POOLCONTRCT_LINE");
                row = oMtx.GetNextSelectedRow(0, BoOrderType.ot_SelectionOrder);
                oMtx.DeleteRow(row);
                if (oMtx.RowCount == 0)
                    oDBDS.RemoveRecord(0);
                if ((form.Mode != BoFormMode.fm_ADD_MODE) | (form.Mode != BoFormMode.fm_UPDATE_MODE))
                    form.Mode = BoFormMode.fm_UPDATE_MODE;
                }</i>

    Hi Ben,
    [B1Listener(BoEventTypes.et_CLICK, false)]
    public virtual void OnAfterClick(ItemEvent pVal)
    bool ActionSuccess = pVal.ActionSuccess;
    Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
    Item item = form.Items.Item("del");
    Button button = ((Button)(item.Specific));
    // ADD YOUR ACTION CODE HERE ...
    int row;
    Matrix oMtx = (Matrix)form.Items.Item("mtx_0").Specific;
    DBDataSource oDBDS = (DBDataSource)form.DataSources.DBDataSources.Item("@SD_POOLCONTRCT_LINE");
    Rest of your code will remain same.
    I am making the modification here. I am using the RowCount property that gives me the address of the last row of the matrix.
    <b>row = oMtx.RowCount;</b>
    Every time this will return you the last row and that row will be deleted.
    <b>row = oMtx.RowCount;</b>
    oMtx.DeleteRow(row);
    if (oMtx.RowCount == 0)
    oDBDS.RemoveRecord(0);
    if ((form.Mode != BoFormMode.fm_ADD_MODE) | (form.Mode != BoFormMode.fm_UPDATE_MODE))
    form.Mode = BoFormMode.fm_UPDATE_MODE;
    Regards,
    Prashant

  • Tabular form last row not accessible through PL/SQL

    i am using apex 3.2
    I have created one tabular form for daily receipt of material.
    data get stared in table storereceipt. Now I have created one PL/SQL , it reads each row of tabular form one by one and update quantity of item in master table.
    begin
    FOR i IN 1 .. apex_application.g_f02.COUNT
    LOOP
    if apex_application.g_f12(i) != 'LOCK' then
    update inv_ms_item set qty = qty apex_application.g_f11(i)+ this row update quantity in another table
    where id = apex_application.g_f10(i);
    end if;
    END LOOP;
    end;
    problem arrives in last row, which was created blank with add row then data was entered and submit button was clicked.
    my pl/sql is called on click of submit button . it updates all items except on last row.
    remaining things works fine.
    if i create 5 rows with add row and click one more time. last row will be blank. now if i click submit then all rows get updated and as last row is blank i dont have to care about it.
    Edited by: TEJU on Oct 21, 2010 4:40 PM
    Edited by: TEJU on Oct 21, 2010 4:40 PM

    Hi ,
    Teju this is the major drawback in the apex 3.2 because if u see the length when there is only one record is present in the tabular form
    then the outpuyt u will get is undefined , but though the colum exists it wont .
    i have faced this problem , one thing u can do is use document.getElementByID method of java script
    first find out the length , that specifies how many rows are present then write a loop
    for 1=0 till i<=-tahta length
    document.getElemetByid('f01_00'+i)
    /* this will give u f01_001 ...this can be ur element 1 , f01_002 this will ur element two .
    I had already used it and its working fine...
    Regards,
    Nandini Thakur.

  • How to get the last row

    I have 10 rows in my table and I have to retrive last row using rownum.
    For this I use
    SELECT * from <table_name>
    where rownum<=10
    minus
    SELECT * from <table_name>
    where rownum<=9
    The result is no rows selected
    In the same case if I use
    SELECT rownum from <table_name>
    Where rownum <= 10
    minus
    SELECT rownum from <table_name>
    where rownum <=9
    The result is 10
    Why this happend.
    If the result is 10, then why the row whose rowid is 10 is not retrived

    All
    Please bear in mind that ROWNUM is an attribute of the query NOT the table. The last row returned by an unORDERed SELECT statement may be the most recently inserted row but is not guaranteed to be so.
    The only way of assuring yourself of returning the most recent row is either to timestamp all your tables with a date_created column or to use a primary key with an ascending value.
    rgds, APC

  • Portal report - If rows returned are 1 greater than max,last row not shown

    We are experiencing what appears to be a bug with reports developed from a locally built Provider in Portal...
    If my "maximum rows to return" is set to 20, and my search returns 21 rows/results, the "next" button to navigate to the last row does not appear. Therefore, the last row is not returned to the user....
    We have been able to duplicate this with any number... For example, if we set the "max rows to be returned" to 59, and our results come back with 60 rows, neither the "next" button or last row are returned...
    Bug by chance?
    Thanks in advance for any help offered....
    ~Chris

    Hi Varsha,
    Please pay attention when you are requesting motnly period for
    start date : 1st July 2008
    end date : 1st july 2008
    After saving the period is changed to
    Start Date : 7/1/2008
    End Date  : 7/31/2008
    When you are requesting weekly period for the same interval, after sving the dates are changed again, according
    you settings of first day of the week. It it is Monday it could be as following
    Start Date : 6/30/2008
    End Date  : 7/6/2008
    So you are asking data for not quite the same period.
    Do you have data for monthly period in that interval?
    Regards,
    Victoria Gur

  • How to find last row in itab?

    hi experts,
                  How to find the last row or item in an itab.I am using if statement for which i have to check the last row and if it is the last row some set of statements should trigger.
    thanks
    mani

    Just, find the last record :
    * Standard table
      DESCRIBE TABLE itab LINES n.
      READ TABLE itab INDEX n.
    Check on the table with special work at last record :
    * Loop
      LOOP AT itab.
        MOVE itab TO wa_itab.
        AT LAST.
    * here wa_itab is the last record (itab is *****)
        ENDAT.
      ENDLOOP.
    Regards

  • How to auto scroll a table to last row when using Active Data Service?  11g

    Hi all,
    Has anyone got any experience with the ADF Active Data Service?
    I am using an af:table in combination with the ADF Active Data Service and I want the table to scroll to the latest row when new data arrives.
    It is basically a simple setup:
    The value attribute of my table points to a bean that extends CollectionModel and implements ActiveDataModel. This works perfectly. A soon as I receive new data in my bean, the table is automatically updated (e.g. a new row is inserted). I use JDev version: 11.1.1.3
    The problem is that I can not get the scroll bar to move down to the last row automatically when new data arrives. The auto scroll only works for the client that actually performs a submit. In other words the person that submits the new data, will see his scrollbar move down, this is because I added the following code:
    RowKeySet rowkeysset = chatTableBinding.getSelectedRowKeys();
    rowkeysset.clear();
    rowkeysset.add(getRowKey());
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.chatTableBinding);
    This does not work for the clients that receive the new data via the Active data model. Apparently the active data service partially refreshes the table, but not in such a way that it sets the selected row to the last row?
    My table definition:
    <af:table value="#{pageFlowScope.chatBean.instantMessagingChatwindowBean}" var="row"
    id="t1" columnStretching="last" rows="10"
    styleClass="AFStretchWidth" autoHeightRows="10" contentDelivery="immediate"
    horizontalGridVisible="false"
    verticalGridVisible="false"
    disableColumnReordering="true" displayRow="last"
    rowSelection="single"
    binding="#{pageFlowScope.chatBean.instantMessagingChatwindowBean.chatTableBinding}"
    inlineStyle="height:80px;">
    p.s.
    The table is used to show incoming chat message.
    I am building a chat client (taskflow) in a Webcenter application. The concept is similar of that presented by Lucas Jellemain in his blogpost on building a Google Talk Client http://www.oracle.com/technetwork/articles/jellema-googletalk-094343.html

    Dan,
    This is a thanks for posting your findings. You saved me quite some time.
    <af:selectBooleanCheckbox id="showOnlyActiveSubscriptions" selected="true"
    label="Show only active services:"
    value="#{servicePortfolioBean.showOnlyActiveSubscriptions}"
    autoSubmit="true" />
    <af:table binding="#{servicePortfolioBean.serviceTable}" ...
    partialTriggers="showOnlyActiveSubscriptions">
    Of course, when I add a "ValueChangeListener" to the selectBooleanCheckbox, the PPR stops working. :( I wonder why?

  • Delete last row in a table - why won't it delete?

    I cannot delete the last row in any of my tables. (InDesign CS2). The option is greyed out - is this by design or a bug and how can I delete it?
    Thanks.

    No,
    The table has two header rows and no footers. The row I cannot delete is the third row which must therefore be a body row.

  • Problems deleting last row of table

    I have tried a number of examples to make a button delete the LAST row of a table, but I cannot make it.
    This is the script I am currently using, but it only delets the second row. I'm desperate, I don't know where's the mistake. Please help!
    var sSubformSOM = "xfa.form.Summary.INTrack.INRecordTable.INRecord.Row1";
    var bCalc = true;
    var message = "You have reached the maximum number of items allowed.";
    var oSubform = xfa.resolveNode(sSubformSOM);
    var sParentSOM = oSubform.parent.somExpression;
    var sManagerSOM = sParentSOM + "._" + oSubform.name;
    var oManager = xfa.resolveNode(sManagerSOM);
    var nMinCount = oManager.occur.min;
    var nSubCount = oManager.count;
    if (nSubCount > nMinCount) {
              oManager.removeInstance(1);
              if (bCalc == true) {
                        xfa.form.recalculate(1);
    } else {
              xfa.host.messageBox(message,"Remove Item", 3);

    Hi
    In fact what you want is somehow strange. But this may be used.
    For the first row:
    <b>SELECT * FROM <table_name> UP TO 1 ROWS
    INTO gs_record</b>
    <i>*-- If you want you can use <b>"ORDER"</b> statement here to order *the contents</i><b>.</b>
    For the last row:
    As far as I know, You should select all the records till the last row and then get the last row.
    But, I think without ordering it will be somehow weird. We do not deal how the database layer handles order of the table. It has different policies regarding indexes etc... If you have an ordering condition, I think it will often be more convenient using an internal table to handle data. That is, retrieve your data with SELECT statement into an internal table, sort it and read it.
    *--Serdar

Maybe you are looking for

  • Calucation of Tax Amount in FB70

    Hi Guru's, Here Tax Procedure is TAXINN in which I have maintain Tax Code V9 as 14.42% (EXCISE+CESS) + 12.5% (VAT) in FV11. So while doing MIRO I select V9 Tax code then automatically Tax amount is calculated. My question is can same can done in FB60

  • Very Slow VDI Client Login Time

    Hi, My environment contains two Hyper-V Servers for DCs, Connection Broker, RD-Web, and two Hyper-V servers as virtualization host to thin clients. All Hyper-V servers are only 35% utilized and all client VMs don't have a performance issue. After set

  • Initialize the shared variable

    "From the issue description it seems that the Shared variable needs to be reinitialize. Create a formula to initialize the shared variable value and place it in appropriate section of the Main Report based on the section in which you are displaying s

  • Songs not syncing after disabling iTunes Match

    I subscribed to iTunes Match a week ago and uploaded my library. Then I enabled iTunes Match on my iPhone 4S and my iPad2. Yesterday I decided to disable iTunes Match on my iOS devices and synced them with my MacBook again. Now the problem: About hal

  • Which is better. . . a Canon Sure Shot or a Canon Power Shot?

    I need to purchase a camera good enough to get good close-ups for items to sell on eBay.  Which is better...a Canon Sure Shot or a Canon Power Shot?