Select list using many-to-one relationship [message #613918] |
Tue, 13 May 2014 09:44 |
|
mhugh
Messages: 10 Registered: May 2014
|
Junior Member |
|
|
I have created an interactive report in APEX using the code below to bring in the table signature_bib:
select ID, Author, pub_date, pub_title, journal, keyword, PI
from Signature_Bib
where ID=NVL(:P3_ID, ID)
I have created a table sig_keywords with three variables: ID (sequentially assigned),
Key_id and keyword. For each ID from signature_bib, there are multiple KEY_IDs with a
unique keyword, e.g., KEY_ID=1 and keyword=Fish, KEY_ID=1 and keyword=nitrogen, etc. So,
this is a many-to-one relationship.
I want to create a 'keyword' filter on the signature_bib report using a select list from sig_keywords
to select signature_bib entries. Key_id from sig_keywords relates to ID in signature_bib. I have
tried the code below to create the select list page control under the filter. The filter shows up, but
there is no keyword list, only a NULL value. There is no error message.
How do I connect the two tables to get a keyword list? If I run the
basic code in the SQL command region, it runs without a problem.
select DISTINCT k.keyword d ,b.ID r
from sig_keywords k, signature_bib b
where b.ID =k.key_id and
b.ID=:P3_id
group by k.keyword , b.ID
order by k.keyword
|
|
|
Re: Select list using many-to-one relationship [message #613952 is a reply to message #613918] |
Tue, 13 May 2014 16:33 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Try to comment this line out: What happens? Does anything show in the select list? If so, it means that P3_ID's value isn't saved in session state so you'll have to do it yourself.
By the way (not related to your problem): remove GROUP BY clause, it does nothing in this context.
[EDIT] As you didn't reply (yet?), I don't know whether you managed to fix it or not. Anyway: "you'll have to do it yourself" can be done in a simple manner by putting P3_ID into select list's "Cascading LOV Parent Item(s)" property.
[Updated on: Wed, 14 May 2014 00:13] Report message to a moderator
|
|
|
|
|
|
|
|
|