-
many to one recordset return
I have a table, NOTES_TO_THE_RECORD and each note can have several attendees (so many to one relationship). I can query the note information and download the recordset to an excel spreadsheet fine. But that's working with the main notes table. It doesn't contain the attendees. I don't know how to get several attendees into the notes recordset. Each attendee has fname, lname, title fields, as well as others.
So, should I make a set of string variables one for each attendee and inside it populate it with a created string of fname lname title. Maybe make one big string instead and populate it with all the attendee information?
I'm just guessing here - not even sure if that's possible.
Here are the two tables:
create table notes_to_the_record (
n_r_id NUMBER Primary Key,
id NUMBER REFERENCES people(id),
type VARCHAR2(100),
type_describe VARCHAR2(300),
note_date DATE,
date_added DATE,
date_modified DATE,
meeting_name VARCHAR2(300),
notes CLOB,
meeting_log CLOB
)
create table notes_to_the_record_attendees (
n_r_attendees_id NUMBER Primary Key,
n_r_id NUMBER REFERENCES notes_to_the_record(n_r_id) ON DELETE CASCADE,
fname VARCHAR2(100),
lname VARCHAR2(100),
title VARCHAR2(100),
affiliation VARCHAR2(100),
street_1 VARCHAR2(200),
street_2 VARCHAR2(200),
city VARCHAR2(100),
state VARCHAR2(100),
zip VARCHAR2(20),
phone VARCHAR2(40),
email VARCHAR2(100)
)
-
If you join the two tables using N_R_ID, you get the required result set.
Tamil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|