Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Oracle gurus (Specifically CREATE VIEW gods)

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
Hawkeye-X Donating Member (1000+ posts) Send PM | Profile | Ignore Tue Nov-11-03 03:20 PM
Original message
Oracle gurus (Specifically CREATE VIEW gods)
What am I doing wrong?


CREATE VIEW PAPERBACK AS
SELECT BOOK_CODE, TITLE, PUBLISHER_NAME, PRICE FROM
BOOK, PUBLISHER WHERE
PAPERBACK = ‘Y’ AND
PUBLISHER.PUBLISHER_CODE = PUBLISHER.PUBLISHER_CODE;

It tells me that I'm missing an expression on line 3

I'm supposed to call everything with ALL paperback and
the publisher name is on a different table (PUBLISHER) instead
of the book table. The book table has a foreign key (PUBLISHER_CODE)
to help reference the PUBLISHER table.

Hawkeye-X
Printer Friendly | Permalink |  | Top
jono Donating Member (1000+ posts) Send PM | Profile | Ignore Tue Nov-11-03 03:24 PM
Response to Original message
1. Aliases
Both your tables are aliased PUBLISHER in your join statement:

PUBLISHER.PUBLISHER_CODE = PUBLISHER.PUBLISHER_CODE

I assume it should read:

BOOK.PUBLISHER_CODE = PUBLISHER.PUBLISHER_CODE

:hi:
Printer Friendly | Permalink |  | Top
 
WhoCountsTheVotes Donating Member (1000+ posts) Send PM | Profile | Ignore Tue Nov-11-03 03:39 PM
Response to Original message
2. line 3
PUBLISHER.PUBLISHER_CODE = PUBLISHER.PUBLISHER_CODE

should be

PUBLISHER.PUBLISHER_CODE = BOOK.PUBLISHER_CODE

probably
:)
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Fri Apr 19th 2024, 01:39 AM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC