Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    3

    Question Unanswered: SQL View problem

    Hello All I am new to Oracle and SQl I have been trying to create the following view for a script and keep getting amissing expression error.
    Here is my script and the error any suggestions?
    Thanks to all in advance


    CREATE VIEW BRANCH_REPORT(BRANCH_NUM,TITLE,PUBL_NAME,PRICE,UOH
    ) AS
    SELECT N.BRANCH_NUM, P.PUBLisher_CODE||'-'||RTRIM(P.PUBLisher_NAME),||' '||RTRIM(B.Book_PRICE),
    ||RTRIM(I.Units_on_Hand),
    FROM BRANCH N, PUBLISHER P, INVENT I, BOOK B
    WHERE N.BRANCH_NUM = I.BRANCH_NUM
    and P.publisher_code = B.publisher_code
    and I.Book_code = b.book_code;
    T N.BRANCH_NUM, P.PUBLisher_CODE||'-'||RTRIM(P.PUBLisher_NAME),||' '||RTRIM(B.Book_PRICE),||' '
    *
    at line 2:
    0936: missing expression

  2. #2
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    140
    Code:
    CREATE VIEW BRANCH_REPORT(BRANCH_NUM,TITLE,PUBL_NAME,PRICE,UOH
    
    ) AS 
    SELECT 
    N.BRANCH_NUM, 
    P.PUBLisher_CODE||'-'||RTRIM(P.PUBLisher_NAME),
    ||' '||RTRIM(B.Book_PRICE),
    ||RTRIM(I.Units_on_Hand),
    from ...
    Just have a look at the SELECT. "||" is used for concatenation. You cannot start an expression with "||". Also, you put a comma just before the FROM keyword !

    Shouldn't your select be :
    Code:
    SELECT 
    N.BRANCH_NUM, 
    P.PUBLisher_CODE,
    RTRIM(P.PUBLisher_NAME),
    RTRIM(B.Book_PRICE),
    RTRIM(I.Units_on_Hand)
    FROM ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •