How can I delete records from database with multiple keyfields

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default How can I delete records from database with multiple keyfields

    Say we have a simple set of tables: Authors, Books, and AuthorBooks; Authors
    has an author_id primary key field; Books has a book_id primary key field; and
    AuthorBooks has two key fields: author_id and book_id. Now say I want to
    delete one of the AuthorBooks relationships on a web page with Dreamweaver. I
    have a page with URL Form variables passed to it for author_id and book_id and
    the record is displayed. I now add a delete button and I want to delete the
    AuthorBooks record for the given record when the button is pressed. Under
    server behaviors, I attempt to add the Delete Record behavior and the Delete
    record dialog pops up. The Unique Key Column pull down only lets me select one
    key field but I have two (author_id and book_id). How do I delete the record?
    I am using the JSP Application model.

    Thanks for any help!

    Todd

    rtmarkley Guest

  2. Similar Questions and Discussions

    1. Why can't I delete these records?
      Hi all! When I do: SELECT COUNT(*) AS counter FROM table1 WHERE condition1 = 'A' AND condition2 IS NULL; it returns: +---------+ | counter...
    2. How to delete records from a database using CFGRID
      I want to delete records from a database. The records is checked in checkboxes in a CFGRID and the actionscript is called when submitting the...
    3. Delete records
      Hi, I have produced a page used a webthang tutorial ?Deleting Multiple Records Using Checkboxes by Rob Boyle? to delete records....
    4. Delete multiple records from database
      I am having troubles getting a delete query to accect multiple entries in the where clause. I need to be able to delete a varying number of records...
    5. Updating Multiple records fields in a database atonce
      Is it correct that there is no user interaction on these forms? I didn't see a submit button. Or does someone click on a submit button to get to...
  3. #2

    Default Re: How can I delete records from database with multiple key fields

    Your authorbook table needs to have a primary key of its own and then you
    would use that to define the delete relationship.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "rtmarkley" <webforumsuser@macromedia.com> wrote in message
    news:d0l4ph$gv4$1@forums.macromedia.com...
    > Say we have a simple set of tables: Authors, Books, and AuthorBooks;
    Authors
    > has an author_id primary key field; Books has a book_id primary key
    field; and
    > AuthorBooks has two key fields: author_id and book_id. Now say I want to
    > delete one of the AuthorBooks relationships on a web page with
    Dreamweaver. I
    > have a page with URL Form variables passed to it for author_id and book_id
    and
    > the record is displayed. I now add a delete button and I want to delete
    the
    > AuthorBooks record for the given record when the button is pressed. Under
    > server behaviors, I attempt to add the Delete Record behavior and the
    Delete
    > record dialog pops up. The Unique Key Column pull down only lets me
    select one
    > key field but I have two (author_id and book_id). How do I delete the
    record?
    > I am using the JSP Application model.
    >
    > Thanks for any help!
    >
    > Todd
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: How can I delete records from database with multiple key fields

    You'd need to write your own command rather than use the built-in one.

    "rtmarkley" <webforumsuser@macromedia.com> wrote in message
    news:d0l4ph$gv4$1@forums.macromedia.com...
    > Say we have a simple set of tables: Authors, Books, and AuthorBooks;
    Authors
    > has an author_id primary key field; Books has a book_id primary key
    field; and
    > AuthorBooks has two key fields: author_id and book_id. Now say I want to
    > delete one of the AuthorBooks relationships on a web page with
    Dreamweaver. I
    > have a page with URL Form variables passed to it for author_id and book_id
    and
    > the record is displayed. I now add a delete button and I want to delete
    the
    > AuthorBooks record for the given record when the button is pressed. Under
    > server behaviors, I attempt to add the Delete Record behavior and the
    Delete
    > record dialog pops up. The Unique Key Column pull down only lets me
    select one
    > key field but I have two (author_id and book_id). How do I delete the
    record?
    > I am using the JSP Application model.
    >
    > Thanks for any help!
    >
    > Todd
    >

    CMBergin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139