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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Problems - Help!!!

Re: SQL Problems - Help!!!

From: James Lorenzen <james_lorenzen_at_allianzlife.com>
Date: Tue, 18 May 1999 17:33:02 GMT
Message-ID: <7hs88f$hfp$1@nnrp1.deja.com>


IF you are using Oracle (based on posting this in an Oracle Newsgroup), then you need to remove the "join" syntax from the FROM clause and place it in the WHERE clause. I.E.

SELECT mc.VENDOR.vendoi,mc.VENDOR.id as VendorID,

   mc.CONTACT.cntcoi AS ID,
   mc.CONTACT.aenm AS Name, mc.CONTACT.aenm AS LastName,
   mc.CONTACT.prefnm AS FirstName,
   mc.CONTACT.jbttle, mc.CONTACTYPE.id AS ContactType,
   mc.CONTACT.Language_id AS Language,
   mc.CONTACT.addr, mc.CONTACT.postcd AS code,
   mc.REGIONLIST.regn AS Region,
   mc.COUNTRYLIST.cntry AS Country,
   mc.CONTACT.phone, mc.CONTACT.fax

FROM mc.VENDOR, mc.CONTACT, mc.CONTACTYPE,

   mc.REGIONLIST, mc.COUNTRYLIST
WHERE mc.CONTACT.cntctyp_oi = mc.CONTACTYPE.cntpoi

   AND mc.CONTACT.Region_oi = mc.REGIONLIST.regnoi
   AND mc.REGIONLIST.ctry_oi = mc.COUNTRYLIST.ctryoi
   AND mc.VENDOR.cntctyp_oi = mc.CONTACT.cntcoi
   AND ((mc.VENDOR.susp_oi) Is Null)
   AND ((mc.CONTACT.cntcoi) Is Not Null)

In article <7hs08a$bvp$1_at_nnrp1.deja.com>,   schnauzers_at_my-dejanews.com wrote:
> I am having problems with the following sql
> statement. I get a SQL command not properly
> ended error when it hits the first join. Any
> help will be greatly appreciated!
>
> SELECT mc.VENDOR.vendoi,mc.VENDOR.id as
> VendorID,mc.CONTACT.cntcoi AS ID,
> mc.CONTACT.aenm AS Name, mc.CONTACT.aenm
> AS LastName,
> mc.CONTACT.prefnm AS FirstName,
> mc.CONTACT.jbttle,
> mc.CONTACTYPE.id AS ContactType,
> mc.CONTACT.Language_id AS Language,
> mc.CONTACT.addr, mc.CONTACT.postcd AS
> code, mc.REGIONLIST.regn AS Region,
> mc.COUNTRYLIST.cntry AS Country,
> mc.CONTACT.phone, mc.CONTACT.fax
> FROM mc.VENDOR LEFT JOIN (((mc.CONTACT
> LEFT JOIN mc.CONTACTYPE ON
> mc.CONTACT.cntctyp_oi =
> mc.CONTACTYPE.cntpoi)
> LEFT JOIN mc.REGIONLIST ON
> mc.CONTACT.Region_oi = mc.REGIONLIST.regnoi)
> LEFT JOIN mc.COUNTRYLIST ON
> mc.REGIONLIST.ctry_oi = mc.COUNTRYLIST.ctryoi)
> ON mc.VENDOR.cntctyp_oi =
> mc.CONTACT.cntcoi
> WHERE ((mc.VENDOR.susp_oi) Is Null) AND
> ((mc.CONTACT.cntcoi) Is Not Null)
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
>

--== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.--- Received on Tue May 18 1999 - 12:33:02 CDT

Original text of this message

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