If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL View problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-03, 00:24
bllaker80 bllaker80 is offline
Registered User
 
Join Date: Dec 2003
Posts: 3
Question 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
Reply With Quote
  #2 (permalink)  
Old 12-09-03, 04:03
cvandemaele cvandemaele is offline
Registered User
 
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 ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On