Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Question on View

RE: Question on View

From: Afanassiev, Alex <Alex.Afanassiev_at_team.telstra.com>
Date: Fri, 15 Sep 2000 09:11:34 +1100
Message-Id: <10619.117037@fatcity.com>


Hi Bajwa, Sandeep S

Remove comma after CE.location_city and single quotes from to_number

create view test_vw
as select
to_number
(substr(C.course_id,1,3)||substr(CE.sessions_id,1,5),'99999999') "test_id",
C.course_id,
CE.location_city
from COURSES C, COURSES_SESSIONS CE;

HTH With regards
Alex Afanassiev
Oracle DBA, TOC OPS/Internet.Operations

Tel:	(03) 8 661 20 61
Fax:	(03) 9 650 36 74



> -----Original Message-----
> From: Bajwa, Sandeep S [SMTP:BajwaSS_at_ch.etn.com]
> Sent: Friday, September 15, 2000 4:05 AM
> To: Multiple recipients of list ORACLE-L
> Subject: Question on View
>
> I want to create a view where one column is a
> combination of two columns (from two different tables).
>
> i.e. course_id and sessions_id are both numbers, for example
> if course_id=123 and sessions_id=12345 I want test_id (on view)
> to look like 12312345 (and be a number).
>
> create view test_vw
> as select
> to_number
> '(substr(C.course_id,1,3)||''||substr(CE.sessions_id,1,5)','99999999')
> "test_id",
> C.course_id,
> CE.location_city,
> from COURSES C, COURSES_SESSIONS CE;
>
> What am I doing wrong here? (error is
>
> ERROR at line 3:
> ORA-00923: FROM keyword not found where expected)
> *
>
>
> --
> Author: Bajwa, Sandeep S
> INET: BajwaSS_at_ch.etn.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Received on Thu Sep 14 2000 - 17:11:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US