Connecting Tech Pros Worldwide Help | Site Map

query the results of a table function applied to all the rows of a different table

Newbie
 
Join Date: Aug 2007
Posts: 2
#1: Aug 28 '07
I have two tables:

book_table, primary key book_key.
book_authors, foreign key book_key

the function get_book_authors returns a set of rows from the book_authors_table given a book_key. Here's a sample query:

Expand|Select|Wrap|Line Numbers
  1. select * from get_book_authors(3);
Now let's say that I have a third table, book_store, which has a primary_key book_store_key. The book_table references this table.

I'd like to get all the book_authors for a particular book_store, or for all the books in the book_table.

I tried
Expand|Select|Wrap|Line Numbers
  1. select book_key,get_book_authors(book_key) from book_table;
but it's been deprecated as of 8.1.

Any ideas on how to do this?
Thanks
Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505
#2: Aug 30 '07

re: query the results of a table function applied to all the rows of a different table


Deprecated functions still work, but personally I would write a new function or SQL query for this.
The obscure syntax of mixing function call with a regular "select from" is not something I would normally use in the application.
Newbie
 
Join Date: Aug 2007
Posts: 2
#3: Aug 31 '07

re: query the results of a table function applied to all the rows of a different table


Ok, thanks. I was just curious whether this could be done with a single query.
Reply