Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #687

Re: joining

From Chris Riesbeck <Chris.Riesbeck@gmail.com>
Newsgroups comp.lang.java.databases
Subject Re: joining
Date 2014-08-11 12:23 -0500
Message-ID <53E8FC07.1030200@gmail.com> (permalink)
References (2 earlier) <c4kdkrF2fanU1@mid.individual.net> <2uuau91djaahko0hk0h9tiffr09639v5uj@4ax.com> <53e5ac58$0$2846$e4fe514c@news2.news.xs4all.nl> <s5rbu99i3c06ng4ln3o89u8226uar3qjf5@4ax.com> <53e5f4f6$0$2925$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


On 8/9/2014 5:16 AM, Silvio wrote:
> On 08/09/2014 11:45 AM, Roedy Green wrote:
>> On Sat, 09 Aug 2014 07:06:31 +0200, Silvio <silvio@internet.com>
>> wrote, quoted or indirectly quoted someone who said :
>>
>> The way I handle it now, I create a quote record, then look up a
>> author record by name, if I find one, I put its uniqueid number in the
>> quote record.  If it does not exist, I create one, fill in the fields.
>> and put its unique id number in the quote record.
>>
>> Can that be handled as if there were one unified empty joined record
>> and I fill in all the fields.  It then hooks everything up, creating
>> as new author record as needed? or is join just for lookup?
>>
>
> No, you can not do that in one go. In some cases you can update a join
> but I do not know of any RDBMS that supports inserting into joins.
>
> There are two approaches here: you either check on the presence of the
> author name by selecting its id by name or you insert (name,id) and let
> the insert fail (return 0 records updated) if the name is already
> present by adding a unique index on the author name (which is probably a
> good idea anyway).

For various reasons, you might be better off first retrieving on name, 
with some intelligent fuzzy matching, anyway, to avoid entering 
duplicate and erroneous author names. If you really wanted to get fancy, 
have an author ID table that you join with an id-name table, to handle 
authors with more than one commonly used name, e.g., Mark Twain / Samuel 
Clemens.

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Find similar


Thread

joining Roedy Green <see_website@mindprod.com.invalid> - 2014-08-08 05:04 -0700
  Re: joining Lothar Kimmeringer <news200709@kimmeringer.de> - 2014-08-08 15:54 +0200
    Re: joining Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2014-08-08 11:55 -0500
      Re: joining Roedy Green <see_website@mindprod.com.invalid> - 2014-08-08 19:19 -0700
        Re: joining Silvio <silvio@internet.com> - 2014-08-09 07:06 +0200
          Re: joining Roedy Green <see_website@mindprod.com.invalid> - 2014-08-09 02:45 -0700
            Re: joining Silvio <silvio@internet.com> - 2014-08-09 12:16 +0200
              Re: joining Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2014-08-11 12:23 -0500

csiph-web