Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ret_array array_book_t;
- BEGIN
- SELECT ean, ASIN, title, category_amazon, price, review, endpoint,
- publisher, format, pages, dated, edition
- INTO ret_array
- FROM (
- SELECT
- ean, ASIN, title, category_amazon, price, review, endpoint,
- publisher, format, pages, dated, edition, ROWNUM r
- FROM (
- SELECT DISTINCT book.*, id, val, book_id, authors_id
- FROM Book, BookAuthors, Authors
- WHERE (
- ( title_begin IS NULL OR title LIKE 'title_begin%' ) AND
- ( title_end IS NULL OR title LIKE '%title_end' ) AND
- ( title_inc IS NULL OR title LIKE '%title_inc%' ) AND
- ( price_min IS NULL OR price >= price_min ) AND
- ( price_max IS NULL OR price <= price_max ) AND
- ( Book.ean = BookAuthors.book_id ) AND
- ( Authors.id = BookAuthors.authors_id ) AND
- ( authors_begin IS NULL OR BookAuthors.authors_id LIKE 'authors_begin%' ) AND
- ( authors_end IS NULL OR BookAuthors.authors_id LIKE '%authors_end' ) AND
- ( authors_inc IS NULL OR BookAuthors.authors_id LIKE '%authors_inc%' )
- )
- )
- ) WHERE r BETWEEN the_begin AND the_end;
- END search_books;
Add Comment
Please, Sign In to add comment