Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

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, 01: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, 05: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

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