Home » SQL & PL/SQL » SQL & PL/SQL » Missing right parenthesis? (10g, win)
Missing right parenthesis? [message #428388] Wed, 28 October 2009 03:30 Go to next message
Pepask2000
Messages: 10
Registered: October 2009
Junior Member
Dear great "Oracle"

i have come to gain knowledge from you about my future uhm... no, i mean about a problem with my oracle code.

I have pasted a code from my access system into oracle style and suddenly it says "missing right parenthesis".

I don´t know absolutely where my error is and somehow i am too stupid to handle that sql*plus thing.

I can give you the code snippet to have a look on so please don´t blame me for posting such a shame thing.

SELECT 
 AUF_ID, 
 APO_ID, 
 GPR_ADR_NAME, 
 APO_ART_ID, 
 APO_LIEFERDATUM_GEPLANT, 
 APO_MENGE_BESTELLT, 
 APO_PREIS_BESTELLT, 
 AUF_ISO_WAEHRUNGSCODE_ID, 
 APO_PREISMENGE, 
 ART_BEZEICHNUNG_SF, 
 APO_MUTUSER, 
 APO_MUTDAT, 
 APO_BEMERKUNG
FROM 
	(SELECT 
		A.AUF_ID, 
		B.APO_ID, 
		C.GPR_ADR_NAME, 
		B.APO_ART_ID, 
		B.APO_LIEFERDATUM_GEPLANT, 
		B.APO_MENGE_BESTELLT, 
		B.APO_STATUS_ID, 
		B.APO_PREIS_BESTELLT, 
		A.AUF_ISO_WAEHRUNGSCODE_ID, 
		B.APO_PREISMENGE, 
		D.ART_BEZEICHNUNG_SF, 
		B.APO_MUTUSER, 
		B.APO_MUTDAT, 
		B.APO_BEMERKUNG
	 FROM
		((AUFTRAEGE AS A 
		INNER JOIN AUFTRAGSPOSITIONEN AS B ON A.AUF_ID = B.APO_AUF_ID) 
		INNER JOIN GESCHAEFTSPARTNER AS C ON A.AUF_GPR_ID = C.GPR_ID) 
		INNER JOIN ARTIKEL AS D ON B.APO_ART_ID = D.ART_ID
	 WHERE 
	 B.APO_STATUS_ID=90
	 ORDER BY A.AUF_ID, B.APO_ID
	) 
WHERE 
 APO_MUTDAT >= $adat2 AND 
 APO_MUTDAT <= $edat2
ORDER BY AUF_ID ASC


Can you please show me where i misplaced the brackets or tell me why there is a difference in the bracket placing in access and oracle?

Thanks for you help.

Sebastian
Re: Missing right parenthesis? [message #428390 is a reply to message #428388] Wed, 28 October 2009 03:35 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use SQL*Plus and copy and paste your query in it, it will then tell you where there is an error.

Regards
Michel
Re: Missing right parenthesis? [message #428395 is a reply to message #428388] Wed, 28 October 2009 03:46 Go to previous messageGo to next message
ayush_anand
Messages: 417
Registered: November 2008
Senior Member
please remove 'AS's from your From clause
	((AUFTRAEGE  A 
		INNER JOIN AUFTRAGSPOSITIONEN  B ON A.AUF_ID = B.APO_AUF_ID) 
		INNER JOIN GESCHAEFTSPARTNER  C ON A.AUF_GPR_ID = C.GPR_ID) 
		INNER JOIN ARTIKEL  D ON B.APO_ART_ID = D.ART_ID
Re: Missing right parenthesis? [message #428401 is a reply to message #428388] Wed, 28 October 2009 04:12 Go to previous messageGo to next message
Pepask2000
Messages: 10
Registered: October 2009
Junior Member
Is it correct that Oracle does natural joins? For me it seems so, because after i removed all brackets it worked fine.

I hope that sql*plus won´t crash my system again because it sometimes does. Shocked Strange Shocked

Thanks

Sebastian
Re: Missing right parenthesis? [message #428404 is a reply to message #428401] Wed, 28 October 2009 04:14 Go to previous messageGo to next message
ayush_anand
Messages: 417
Registered: November 2008
Senior Member
how can you use 'AS' man.. Its still strange

SQL> select * from test as t
  2  /
select * from test as t
                   *
ERROR at line 1:
ORA-00933: SQL command not properly ended
Re: Missing right parenthesis? [message #428418 is a reply to message #428388] Wed, 28 October 2009 05:14 Go to previous messageGo to next message
kish_ulike
Messages: 30
Registered: June 2008
Location: chennai
Member

This is what you are looking for....i think so..



SELECT auf_id, apo_id, gpr_adr_name, apo_art_id, apo_lieferdatum_geplant,
apo_menge_bestellt, apo_preis_bestellt, auf_iso_waehrungscode_id,
apo_preismenge, art_bezeichnung_sf, apo_mutuser, apo_mutdat,
apo_bemerkung
FROM (SELECT a.auf_id, b.apo_id, c.gpr_adr_name, b.apo_art_id,
b.apo_lieferdatum_geplant, b.apo_menge_bestellt,
b.apo_status_id, b.apo_preis_bestellt,
a.auf_iso_waehrungscode_id, b.apo_preismenge,
d.art_bezeichnung_sf, b.apo_mutuser, b.apo_mutdat,
b.apo_bemerkung
FROM (auftraege a INNER JOIN auftragspositionen b
ON (a.auf_id = b.apo_auf_id)
INNER JOIN geschaeftspartner c ON (a.auf_gpr_id = c.gpr_id
)
INNER JOIN artikel d ON (b.apo_art_id = d.art_id))
WHERE b.apo_status_id = 90
ORDER BY a.auf_id, b.apo_id)
WHERE apo_mutdat >= $adat2 AND apo_mutdat <= $edat2
ORDER BY auf_id ASC


Regards
Kishore
Re: Missing right parenthesis? [message #428419 is a reply to message #428418] Wed, 28 October 2009 05:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As I said after your first answer:
Michel Cadot wrote on Mon, 26 October 2009 11:05
Thanks to answer this forum.
Please read OraFAQ Forum Guide.

Please carefully read "How to format your post?" section.

Regards
Michel
Re: Missing right parenthesis? [message #428425 is a reply to message #428388] Wed, 28 October 2009 06:02 Go to previous messageGo to next message
Pepask2000
Messages: 10
Registered: October 2009
Junior Member
Thanks a lot, my question is solved!
Re: Missing right parenthesis? [message #428523 is a reply to message #428425] Wed, 28 October 2009 11:23 Go to previous message
kish_ulike
Messages: 30
Registered: June 2008
Location: chennai
Member

Pepask....i am kishore....is my ans is correct

[Updated on: Wed, 28 October 2009 11:24]

Report message to a moderator

Previous Topic: Getting data from 3 rows with three fields to 1 row with 9 fields
Next Topic: How to resolve the problem of : identifier 'DBMS_LOCK' must be declared
Goto Forum:
  


Current Time: Tue Dec 06 00:21:26 CST 2016

Total time taken to generate the page: 0.11144 seconds