Create Trigger to Delete from multiple tables

Hello:
I'm trying to write a trigger which will allow me to delete from multiple records. I have two tables where the record for the same client_id needs to be deleted.
Is it possible to do this? I started writing some code and this is what I have so far:
create or replace trigger app_t1
before delete on <table1> ?? -
for each row
begin
delete from client where clientid = :new.clientid;
delete from key where pk = :newclientid;
end;I'm stuck on the line where I have "before delete on" where I'm supposed to provide a table name. I can only use one table and I need to delete from two.
This trigger is supposed to be used within APEX. In APEX, fields are designated as :P1_clientid where P1 references page 1 of the application. Yet, :P1_clientid is set to the field clientid in the table.
So when I write my trigger, I'm not sure how I'm supposed to set my variables.
Can someone help?
I'm also going to post this into the APEX forum.
Thanks.

It's not clear to me if you are just trying to keep two tables in syn or whether you are trying to achieve something else.
A couple of points though:
- In delete database triggers the :new attributes are NULL. You probably mean to use the :old attributes.
- Is there some relationship between the two tables? If so, setting the foreign key to CASCADE DELETE might do the trick for you.
- Another option - better than a database trigger in my opinion - is to just code a procedure that deletes from both tables and call that one from APEX.
Regards,
Rob.

Similar Messages

  • Deleting from multiple tables

    I have a master table and a detail table. I need to delete a set of records from both the master and detail tables based on a criteria. Now if I delete from one table then I will not know which records I have to delete from the other table. So the records needs to be deleted from both the tables using the criteria. My SQL statement to select the records is
    <<
    select *
    FROM TL_RATE A, TL_RATE_DETAIL B
    WHERE A.CARRIER_ID = B.CARRIER_ID
    AND A.TARIFF_CLASS_ID = B.TARIFF_CLASS_ID
    AND A.LANE_ID = B.LANE_ID
    AND A.SERVICE_COM_ID = B.SERVICE_COM_ID
    AND A.EFFECTIVE = B.EFFECTIVE
    AND DATE_INVALID < SYSDATE-365;
    >>
    Thanks

    You don't show what table DATE_INVALID is in. However, you should just delete the matching rows from the OTHER table first then that table. This is very slightly different from the rows returned by your query since your query is an inner join. In other words, you're excluding rows that might exist in one table but not the other. Assuming DATE_INVALID is in TL_RATE ...
    delete tl_rate_detail
    where (CARRIER_ID, TARIFF_CLASS_ID, LANE_ID, SERVICE_COM_ID, EFFECTIVE) in (
      select CARRIER_ID, TARIFF_CLASS_ID, LANE_ID, SERVICE_COM_ID, EFFECTIVE
      from tl_rate
      where date_invalid < sysdate - 365)
    delete tl_rate
    where date_invalid < sysdate - 365
    /Richard

  • Deleting from multiple tables where few tables have same column name

    Hi,
    I am new to PL/SQL and need some help. I need to delete data older then X years from some 35 odd tables in my schema and out of those tables 25 tables have same column name on which i can have my "where" clause and rest 10 table have different table names. I am doing something like this :
    declare
    table_list UTL_FILE.FILE_TYPE;
    string_line VARCHAR2(1000);
    tables_count number:=0;
    table_name VARCHAR2(400);
    column_name VARCHAR2(400);
    BEGIN
    table_list := UTL_FILE.FOPEN('ORALOAD','test7.txt','R');
    DBMS_OUTPUT.PUT_LINE(table_list);
    LOOP
    UTL_FILE.GET_LINE(table_list,string_line);
    table_name := substr(string_line,1, instr(string_line,'|')-1);
    column_name := substr(string_line, instr(string_line,'|')+1);
    DBMS_OUTPUT.PUT_LINE(table_name);
    DBMS_OUTPUT.PUT_LINE(column_name);
    IF column_name = 'SUBMISSION_TIME' THEN
    delete from :table_name where to_date(:column_name)<(sysdate-(365*7));
    ELSE
    delete from || table_name || where ( || to_date(column_name) || ) <(sysdate-(365*7));
    END IF;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    UTL_FILE.FCLOSE(table_list);
    DBMS_OUTPUT.PUT_LINE('Number of Tables processed is : ' || tables_count);
    UTL_FILE.FCLOSE(table_list);
    END;
    WHERE the text file "text7.txt" contains list of table name and column names separated by a pipe line. But when I execute the above proc it gives error "invalid table name".
    Can something like this be done or is there any other way to execute this task of deletion from 35 tables.
    Thanks.

    Thanks for replies. I don't know what I am doing wrong but still not getting this damn thing work...This is the proc i am running now :
    declare
    table_list UTL_FILE.FILE_TYPE;
    string_line VARCHAR2(1000);
    tables_count number:=0;
    table_name VARCHAR2(4000);
    column_name VARCHAR2(4000);
    code_text VARCHAR2(2000);
    BEGIN
    table_list := UTL_FILE.FOPEN('ORALOAD','test7.txt','R');
    LOOP
    UTL_FILE.GET_LINE(table_list,string_line);
    table_name := substr(string_line,1, instr(string_line,'|')-1);
    column_name := substr(string_line, instr(string_line,'|')+1);
    IF column_name = 'SUBMISSION_TIME' THEN
    DBMS_OUTPUT.PUT_LINE('do nothing');
    ELSE
    code_text:= 'begin delete from'|| (table_name) ||'where to_date' || (column_name) || '<(sysdate-(365*7))';
    Execute Immediate code_text;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    UTL_FILE.FCLOSE(table_list);
    DBMS_OUTPUT.PUT_LINE('Number of Tables processed is : ' || tables_count);
    UTL_FILE.FCLOSE(table_list);
    END;
    But it gives following error :
    " ORA-06550: line 1, column 51:
    PL/SQL: ORA-00933: SQL command not properly ended
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 1, column 68:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    ORA-06512: at line 22 "

  • Deletion from multiple tables

    Hi,
    I am having three tables
    Payment (Parent)
    Header (Child)
    Items (Grand Child)
    one payment can have multiple header and the header can have multiple item in it.
    P
    H H -- level 1
    I I I I -- level 2
    e.g one payment is having 2 headers and each header is having 2 items in it.
    I need to delete the item table first then header table then payment table.
    Condition for deletion. There is field(flag) in item table which decides when to delete record. I need to delete record when all the item records flag value is 2.
    How to check for all items flag value?
    P1
    H1 H2
    I1 I2 I3 I4
    2 1 1 1
    P1
    H1 H2
    I1 I2 I3 I 4
    1 1 2 2
    Since if we miss any check at level 1 or level 2 We will be having Orphan records in the database.
    First case(Level 2 check is missed)then
    I1 -> H1 -> P1 deleted
    and we have H2,I2,I3,I4 Orphans
    Second Case (Level 1 Check is missed)then
    I3,I4 -> H2 -> P1 deleted
    and we have H1,I1,I2 as orphans.
    Please help how to check the flag value of each item. These table are related through primary and foreign keys.
    Thanks in advance
    Edited by: anu2 on Oct 20, 2009 12:04 AM

    Double negation coming up again...
    You can identify the parents that are eligable for deletion as follows:
    select p.*
    from Payment p
    where not exists
          (select 'x'
           from Header h
           where h.FK = p.PK
             and not exists
                  (select 'x'
                   from Items i
                   where i.FK = h.PK
                     and i.status != 2))And then use the resultset of above query to:
    - delete the grandchildren of these parents first,
    - and then delete the children of these parents,
    - and then delete the parents.
    Maybe this helps.
    Edited by: Toon Koppelaars on Oct 20, 2009 9:19 AM

  • Deleting from multiple table using hsql

    I am having the following code which runs fine with mysql. But the sql statement fails for hsql (hipersonic database). Can you please give
    some pointershow the statement should be for hsql
    ================CODE====================
    import org.springframework.jdbc.core.JdbcTemplate
    def statement = "delete a, ac, ace from Alarm a, AlarmCause ac, AlarmCauseElement ace where a.timeStamp <= ? and a.id=ac.alarm_id and
    ac.id=ace.cause_id"
    JdbcTemplate.
    int rows = jdbcTemplate.update(statement, 1000000000) // I just added 1000000000 as sample date
    ===============ERROR=====================
    PreparedStatementCallback; bad SQL grammar [delete a, ac, ace from Alarm a, AlarmCause ac, AlarmCauseElement ace where a.timeStamp <= ? and
    a.id=ac.alarm_id and ac.id=ace.cause_id]; nested exception is java.sql.SQLException: Unexpected token A, requires FROM in statement [delete a,
    ac, ace from Alarm a, AlarmCause ac, AlarmCauseElement ace where a.timeStamp <= ? and a.id=ac.alarm_id and ac.id=ace.cause_id]

    2. Explain what "does not work" means exactly.Reading between the lines the OP is trying to remove rows from three different tables. Perhaps the following from the original post really does work in MySQL?
    delete a, ac, ace from Alarm a, AlarmCause ac, AlarmCauseElement ace where a.timeStamp <= ? and a.id=ac.alarm_id and ac.id=ace.cause_idHowever I doubt you can do join deletes in HSQL. So he will probably need to split it into multiple deletes based upon subqueries. Something like:
    delete from AlarmCauseElement where cause_id in ( select ac.id from Alarm a left join AlarmCause ac on ac.alarm_id = a.id where a.timestamp <= ?);
    delete from AlarmCause where alarm_id in (select id from Alarm where timestamp <= ?);
    delete from Alarm where timestamp <= ?;(None of the above is tested).
    Edited by: dcminter on 28-Oct-2009 10:00

  • Delete from multiple tables

    Hello guys,
    Can somebody please help me. I want to delete this one transaction from all the below tables in my testing environment. Can somebody please help me with a script to do that? So basically I want a delete statement for the same select statement I have below.
    select distinct b.*
    from ra_customer_trx_all a,
         ra_customer_trx_lines_all b,
         ra_cust_trx_line_salesreps_all c,
         ra_cust_trx_line_gl_dist_all d,
         ar_payment_schedules_all e
    where a.CUSTOMER_TRX_ID = b.CUSTOMER_TRX_ID
    and b.CUSTOMER_TRX_ID = c.CUSTOMER_TRX_ID
    and c.CUSTOMER_TRX_ID = d.CUSTOMER_TRX_ID
    and d.CUSTOMER_TRX_ID = e.CUSTOMER_TRX_ID
    and b.CUSTOMER_TRX_LINE_ID = d.CUSTOMER_TRX_LINE_ID
    and a.customer_trx_id = 1328 Thanking you in advance

    If you are checking to see if that ID exists in all 5 tables then
    DECLARE
      v_trx_id   ra_customer_trx_all.CUSTOMER_TRX_ID%TYPE;
    BEGIN
      SELECT DISTINCT b.CUSTOMER_TRX_ID
        INTO v_trx_id
        FROM ra_customer_trx_all A,
             ra_customer_trx_lines_all b,
             ra_cust_trx_line_salesreps_all c,
             ra_cust_trx_line_gl_dist_all d,
             ar_payment_schedules_all E
       WHERE A.CUSTOMER_TRX_ID = b.CUSTOMER_TRX_ID
         AND b.CUSTOMER_TRX_ID = c.CUSTOMER_TRX_ID
         AND c.CUSTOMER_TRX_ID = d.CUSTOMER_TRX_ID
         AND d.CUSTOMER_TRX_ID = E.CUSTOMER_TRX_ID
         AND b.CUSTOMER_TRX_LINE_ID = d.CUSTOMER_TRX_LINE_ID
         AND A.customer_trx_id = 1328;
      IF v_trx_id IS NOT NULL
      THEN
        DELETE FROM ra_customer_trx_all
         WHERE CUSTOMER_TRX_ID = v_trx_id;
        DELETE FROM ra_customer_trx_lines_all
         WHERE CUSTOMER_TRX_ID = v_trx_id;
        DELETE FROM ra_cust_trx_line_salesreps_all
         WHERE CUSTOMER_TRX_ID = v_trx_id;
        DELETE FROM ra_cust_trx_line_gl_dist_all
         WHERE CUSTOMER_TRX_ID = v_trx_id;
        DELETE FROM ar_payment_schedules_all
         WHERE CUSTOMER_TRX_ID = v_trx_id;
      END IF;
    END;Other wise do this simply.
    DELETE FROM ra_customer_trx_all
    WHERE CUSTOMER_TRX_ID = 1328;
    DELETE FROM ra_customer_trx_lines_all
    WHERE CUSTOMER_TRX_ID = 1328;
    DELETE FROM ra_cust_trx_line_salesreps_all
    WHERE CUSTOMER_TRX_ID = 1328;
    DELETE FROM ra_cust_trx_line_gl_dist_all
    WHERE CUSTOMER_TRX_ID = 1328;
    DELETE FROM ar_payment_schedules_all
    WHERE CUSTOMER_TRX_ID = 1328;G.
    Edited by: Ganesh Srivatsav on Apr 1, 2011 12:34 PM

  • Create cursor with data from multiple tables

    Hi,
    I need to create a cursor that contains fields from different tables.
    For example:
    Table 1                  Table 2                    Table 3                Table 4
    Col 1 (PK)              Col 2 (Pk)                  Col 4 (Pk)            Col 9 (PK)
    Col 2                     Col 3  (Pk)               Col 5 (PK)            Col 11
    Col 3                     Col 6                     Col 8                 Col 12
    Col 4                     Col 7                     Col 9
    Col 5                                               Col 10
    Col 13
    Col 14I've created the following:
    CURSOR c_test IS
       SELECT a.col 1,
                    a.col 13,
                    a.col 14
                    b.col 6
                    b.col 7
                    c.col 8
                    c.col 10
                    d.col 9
                    d.col 11
       FROM table1 a, table2, b, table3 c, table4 d
       WHERE (b.col 2,  b.col 3, c.col 4, c.col 5) =
                          SELECT a.col 1
                                       a.col 2
                                       a.col 3
                                       a.col 4
                          FROM table1 a
                          WHERE a.col 1 = '123456');But how can I get also the correct data (col 9 and col 11) of table d?
    What's missing in my where clause?
    Hope this is a bit clear.
    Regards,
    Ken

    Something like this:
    CURSOR c_test IS
       SELECT a.col1,
              a.col13,
              a.col14,
              b.col6,
              b.col7,
              c.col8,
              c.col10,
              d.col9,
              d.col11
       FROM table1 a
       JOIN table2 b
       ON  a.col1 = b.col2
       AND a.col2 = b.col3
       AND a.col1 = '123456'
       JOIN table3 c
       ON  a.col3 = c.col4
       AND a.col4 = c.col5
       JOIN table4 d
       ON  a.col1 = d.col9;Check on a.col1 = d.col9, don't whether that's right.

  • Delete records from multiple table

    Hi,
    I need to delete records from multiple tables using a single delete statement. Is it possible ? If so please let me know the procedure.
    Kindly Help.
    Thanks,
    Alexander.

    Hi Tim,
    Syntax of DELETE statement does not allow for multiple tables to be specified in this way. Infact, none of the DMLs allow you to specify table names like this.
    Technically, there are other ways of deleting from multiple tables with one statement.
    1. "Use a trigger":
    What was probably meant by this is that you have a driving-table on which you create a on-delete trigger. In this trigger, you write the logic for deleting from other tables that you want to delete from.
    This does mean a one-time effort of writing the trigger. But the actual DML operation of deleting from all the tables would be simply triggered by a delete on driving-table.
    2. Dynamic SQL:
    Write a PL/SQL code to open a cursor with table-names from which you want the data to be deleted from. In the cursor-for loop, write a dynamic SQL using the table-name to delete from that table.
    3. Using Foreign-Key constraint with Cascade-Delete:
    This I feel is a more 'cleaner' way of doing this.
    Having to delete data from multiple tables means that there is some kind of parent-child relationship between your tables. These relationships can be implemented in database using foreign-key constraints. While creating foreign-key constraint give the 'on delete cascade' clause to ensure that whenever data is deleted from parent-table, its dependent data is deleted from child-table.
    Using foreign-key constraint you can create a heirarchy of parent-child relationships and still your DELETE would be simple as you would only have to delete from parent-table.
    IMPORTANT: Implementing foreign-key constraints would also impact other DML operations that you should keep in mind.

  • Deleting Multiple Rows From Multiple Tables As an APEX Process

    Hi There,
    I'm interesting in hearing best practice approaches for deleting multiple rows from multiple tables from a single button click in an APEX application. I'm using 3.0.1.008
    On my APEX page I have a Select list displaying all the Payments made and a user can view individual payments by selecting a Payment from the Select List (individual items are displayed below using Text Field (Disabled, saves state) items with a source of Database Column).
    A Payment is to be deleted by selecting a custom image (Delete Payments Button) displayed in a Vertical Images List on the same page. The Target is set as the same page and I gave the Request a name of DELETEPAY.
    What I tried to implement was creating a Conditional Process On Submit - After Computations and Validations that has a source of a PL/SQL anonymous block as follows:
    BEGIN
    UPDATE tblDebitNotes d
    SET d.Paid = 0
    WHERE 1=1
    AND d.DebitNoteID = :P7_DEBITNOTEID;
    INSERT INTO tblDeletedPayments
    ( PaymentID,
    DebitNoteID,
    Amount,
    Date_A,
    SupplierRef,
    Description
    VALUES
    ( :P7_PAYMENTID,
    :P7_DEBITNOTEID,
    :P7_PAID,
    SYSDATE,
    :P7_SUPPLIERREF,
    :P7_DESCRIPTION
    DELETE FROM tblPayments
    WHERE 1=1
    AND PaymentID = :P7_PAYMENTID;
    END;
    The Condition Type used was Request = Expression 1 where Expression 1 had a value of DELETEPAY
    However this process is not doing anything!! Any insights greatly appreciated.
    Many thanks,
    Gary.

    ...the "button" is using a page level Target,...
    I'm not sure what that means. If the target is specified in the definition of a list item, then clicking on the image will simply redirect to that URL. You must cause the page to be submitted instead, perhaps by making the URL a reference to the javaScript doSubmit function that is part of the standard library shipped with Application Express. Take a look at a Standard Tab on a sample application and see how it submits the page using doSubmit() and emulate that.
    Scott

  • Creating an XML file from multiple sql tables

    I have very little xml experience, but need to generate an xml file from multiple table. I know what the output needs to look like, but do not know how to setup the code. Any help would be appreciated.
    - <Practice SourceID="EPIC" ExternalPracticeID="PPAWB">
    - <Provider ExternalProviderID="TB2" FirstName="THOMAS G" LastName="BREWSTER">
    - <Patient ExternalPatientID="99999" OldExternalPatID="" FirstName="test" MiddleName="J" LastName="test" Gender="M" DateOfBirth="2005-08-12" SocSecNumber="000-00-0000" LanguageID="22" AddressOne="test" AddressTwo="" City="test" StateID="20" ZipCode="99999" DayPhone="" EveningPhone="207-999-9999" StatusID="">
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="32" MeasureValue="3" MeasureDate="2008-10-24 13:51:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2009-02-09 10:09:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 14:23:00" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:51:00" MeasureDate="2008-10-24 13:51:00" />
    </Patient>
    </Provider>
    </Practice>

    You are interested in XMLElement and probably XMLAgg. Since you didn't list a version, I can't provide links to the corresponding documentation. I cringe at all the attributes on the Patient element as that info should really be elements.
    To create the Measure node, your overall SQL statement may look something like (not tested)
    SELECT XMLElement....
              XMLAgg(SELECT XMLElement
                       FROM measures_table
                      WHERE join condition to parent)
      FROM patient,
           provider,
           practice
    WHERE join conditionsFor additional help, please include your version (4 digits), some sample data, and what you have tried.

  • Create XML (using DTD) from multiple relation tables

    Hello and thank you in advanced.
    I'm trying to create an XML document, based on a specific DTD, by selecting information from multiple tables in the database.
    Is there a tool (in XDK maybe?) that will allow me to map my relational tables to a specific DTD?
    I could build the XML manually, but I was hoping that Oracle has already solved this problem with an automated tool.
    Thanks again,
    Sean Cloutier

    Is that the same thing as me writing an XSQL document which contains all of my queries (or views).
    In other words, do I have to map everything by hand or is there a tool to do that for me?
    thanks again,
    Sean
    null

  • Create object type from multiple tables for select statement

    Hi there,
    I have 3 tables as given below and I wish to create an object type to group selected columns as 'attribute' from multiple tables. 
    I need to create 2 input parameters to pass in - 'attribute' and 'attribute value'  in PL/SQL and these 2 parameters will be
    passing in with 'column name' and 'column value'.  e.g. 'configuration' - the column name, 'eval' - the column value.
    Then, the PL/SQL will execute the select statement with the column and column value provided to output the record. 
    Pls advise and thank you.
    table ccitemnumber
    name                           null     type                                                                                                   
    ccitemnumber                   not null varchar2(20)                                                                                                                                                                                    
    configuration                           varchar2(20)
    item_type                               varchar2(30)
    table productmodel
    productmodelnumber             not null varchar2(6)                                                                                            
    description                             varchar2(60)  
    accesstimems                            number                                                                                                 
    numberofheads                           varchar2(2)
    generation                              varchar2(10)
    numberofdiscs                           varchar2(2)
    factoryapplication                      varchar2(150)
    table topmodel
    stmodelnumber                  not null varchar2(30)                                                                                           
    productfamily                           varchar2(60
    formfactor                              varchar2(10)                                                                                           
    modelheight                             varchar2(10)                                                                                           
    formattedcapacity                       number                                                                                                 
    formattedcapacity_uom                   varchar2(20)
    object type in database
    configuration                           varchar2(20)
    item_type                               varchar2(30)
    numberofheads                           varchar2(2)
    generation                              varchar2(10)
    numberofdiscs                           varchar2(2)
    factoryapplication                      varchar2(150)
    modelheight                             varchar2(10)
    formattedcapacity                       number                                                                                                 
    formattedcapac

    user12043838 wrote:
    Reason to do this as these fields are required to be grouped together as they are created in different tables. They are treated as 'attribute' (consists of many columns) of the part number. So, the PL/SQL is requested to design in a way able for user to pass in the column name and column value or part number, then the select statement should be able to query for the records. Another reason is a new column can be added easily without keep modifying those effected programs. Reuseable too.This basically equates to ... hard to code, hard to maintain, and poor performance.
    Are you really sure you want to do this? This isn't going to be easy-street as you seem to think it is, but it's a one way street to a poorly performing system with security vulnerabilities (google SQL Injection).
    I would highly recommend you reconsider your design decision here.

  • Sample PHP Service selecting from multiple tables

    Hi all!
    I have the following challange:
    How do I properly set up my PHP-service to insert, select, update and delete values from multiple tables?
    So far, the standard templates generated by Flash Builder is based on a single table.
    Example: I have 2 tables: [person] and [school]
    [person] has [person_id, first_name, last_name, birthdate]
    [school] has [school_id, person_id, school_name, city]
    One [person] can have multiple [schools]
    How should I define the selectByID function in PHP to be able to have
    First name: [TextInput /]
    Last name: [TextInput /]
    Birthdate: [DateField /]
    Schools:
    [TabBar: School1, School2, School3 /]
    [ViewStack1]
    School name: [TextInput /]
    Location name: [TextInput /]
    [/ViewStack1]]
    [ViewStack2]
    School name: [TextInput /]
    Location name: [TextInput /]
    [/ViewStack2]]
    [ViewStack3]
    School name: [TextInput /]
    Location name: [TextInput /]
    [/ViewStack3]]
    And even more interesting: How do I update all these fields back to the database?

    First, the relationship between school and person is many-to-many NOT one-to-many -- you will need to add a junction table.
    From the form you have given I would handle insertions like this:
    loop through all the schools and see if the school already exist in the DB. If so, then store the school_id. If not, then create a new record and store the id. You should have an array collection of store_ids by the end of the loop
    Check whether the student exists w/in the DB. If so, then you might consider aborting the operation or you could opt to do an update. If the student doesn't exist, then create a new student record and store the new student_id (mysql::insert_id)
    Loop through the school_id array and add new student_id/school_id records into the junction table.
    Retrieving records is much simpler -- it's just a join on the tables i.e. "SELECT * FROM student INNER JOIN school_student ON student.student_id = school_student.student_id INNER JOIN schools ON school_student.school_id = school.school_id WHERE student.first_name = 'John' AND student.last_name = 'Doe' (assuming there aren't more than one John Does of course!).
    - e

  • Adding Sum Totals from Multiple Tables in A single Document

    Hello All,
    I'm having trouble adding sum totals from multiple tables I've created in a Pages 09 doc. I putting together a spreadsheet for cost projections for a house remodel. I created tables for each room of the house. At the bottom of the document I'd like to have another table that takes the totals from each individual room and adds them up. Problem appears to be that each table has the same x/y axis labels so row and column numbers/letters are repeated so the final table can't quantify thing correctly.
    Any easy solutions? I can't find anything that's helped in my search efforts.
    Thanks,
    Josefis

    Jerry,
    Thanks for the feedback. I thought that might be the case. And you were correct to assume I was more comfortable in Pages. I'm halfway through converting everything to numbers. In the end it will work great too. Just some different formatting/design choices to be made as numbers doesn't appear to be as versatile in the same way pages is with design. So far it looks pretty good though.
    Thanks again,
    Josefis

  • How to create a pdf file from multiple images ?

    Dear All,
    I want to create a SINGLE page pdf file from two or more page size images that are combined to make a single page pdf. Again, this question is on pdfs that are made out of several, atleast  two color images and a black-and-white mask for one of them.
    I have such pdf files from an unknown source (the producer is edited out) whereby there are three tiff images, obtained using the well known pdfimages extractor.
    When I want to make a pdf out of tiff or png or other image formats, I right click and tell Adobe Acrobat to make a pdf.
    However, I dont know how I can give a command to select say,  three tif images and specify which is the mask for which and then join  them in a way that I get the pdf from the composite of the two color images and a mask for one of them.
    Please help me out.
    I am a little familiar with the pdf structure skeleton and when necessary, fixed xref tables in one of my favorite editors. A few years ago, I also wrote a bunch of javascripts to make some annotations and needed some automation and used some itext type libraries. However, I need your help in this problem as I am now rusty and forgot some of what I studied to solve my earlier problems. This is a new problem for me. Gentle hints from you would be very nice to help me in this problem. Please specify if necessary what manual and pages to read. in the pdfspec.
    Best Regards
    Disabled Veteran [physically handicapped]

    Hello Again.
    On Fri, May 11, 2012 at 12:20 PM, lrosenth <[email protected]> wrote:
    >
    > Re: How to create a pdf file from multiple images ?
    >
    > created by lrosenth in PDF Language and Specifications - View the full
    > discussion
    > ________________________________
    >
    > No clue who Irving is…
    >
    I was hoping to have your first name so its easy for me to address you.
    > I have no clue what OS platform, programming language, etc. you use so
    > can’t really narrow things down.
    I would gladly mention that I am working on windows platform, preferably XP.
    I can also work on linux for free products that come with it.
    >  Also, as this is an Adobe forum, we only
    > recommend Adobe products – so there may be other options that even my list
    > wouldn’t include.
    But adding other products, for the help of an adobe products user,
    even if it outside adobe, shall add greater prestige to your company
    and give impression of user-centeredness.
    > If you read ISO 32000-1:2008 (aka the PDF standard), you will find the
    > information about Images and Image Masks well described.  I didn’t think I
    > needed to repeat any of that information.
    Well, just add the few pdf stanzas since you are proficient on it and
    I am presently a little rusty as I mentioned. Just asking a little
    extra yard, not even to go an extra mile.
    > And, if you read that same document, you will see that there is NO SUCH
    > THING as a “text only PDF”.   All PDF documents are structured binary files.
    Well, ascii format or uncompressed format that is human readable. I
    know its a binary file, but human readable ascii version of it.
    I hope you can give me some stanza and various other approaches
    possible so I can select or combine things for myself. I see only a
    miniscule number of posts claiming to have written masks in this forum
    and then with no details.
    Regards
    Roger
    Message was edited by: dying veteran
    because the adobe posting system went crazy and truncated all except the first line ... dunno why

Maybe you are looking for

  • Handling multiple exceptions with a single catch block

    In the following code: try{ catch (NumberFormatException a) { catch (UserDefinedException b) { The code for both catch blocks are identical. Is there no way I can combine these into one block? For example, could I not do: catch ( (NumberFormatExcepti

  • C7 - Bluetooth connection with car kit - problem

    Hi all, Can anyone help me about my problem. I bought new phone Nokia C7 with Anna software and I have a problem with pairing with my car (Bluetooth device Parrot CK3000 Evo). I think that the problem is with phone, because when I paired devices all

  • Full screen problem, with embedded flash player in a flash player

    Hi, I am having an issue with the flash video player embedded within a flash player movie. The issue is that when my main flash is in Full Screen mode and I try to open that screen where embedded movie player is, when it is opened the inner movie pla

  • Down Payments splitted

    when a downpayment is made, the downpayment is splitted between the main cost and the conditions. i dont want this, i only want the downpayment to hit the main cost and the conditions settled when full payment is made. pls help.

  • Solaris 9 container

    anyone tell me how can i install solaris 9 container on solaris 10, also give me a details a bout solaris 9 container (information), and what is the rquirments needed to run solaris 9 containers in solaris 10. Thnks in advnc, Basem