Home » SQL & PL/SQL » SQL & PL/SQL » missing right parenthesis
missing right parenthesis [message #195857] Mon, 02 October 2006 16:20 Go to next message
deongee
Messages: 8
Registered: October 2006
Junior Member
I'm new to Portal and I'm trying to change colors in a field. I'm getting the error "ORA-00907: missing right parenthesis".
Can someone help me?
select to_char (call_date, 'MM DD YYYY') call_date2, status, call_num, '<b>' || clientname || '</b>' clientname, dept_code, staff_id, 
[B][COLOR=red]decode (trunc(sysdate) - trunc(to_date (call_date)) call_date3, '1', 'red', 2, 'blue', 3, 'black')[/COLOR] [/B]
from hd_call
where call_date between '01-May-06' and '02-May-07'
and staff_id = decode ('##Param1##', 'ALL', staff_id, '##Param1##')
and status = decode ('##Param2##', 'ALL', status, '##Param2##') 
and dept_code = decode ('##Param3##', 'ALL', dept_code, '##Param3##')
and not ('##Param1##' = 'ALL' and '##Param2##' = 'ALL' and '##Param3##' = 'ALL' )
Re: missing right parenthesis [message #195869 is a reply to message #195857] Mon, 02 October 2006 18:00 Go to previous messageGo to next message
deongee
Messages: 8
Registered: October 2006
Junior Member
I'm sorry the [b][color=red] tags are not a part of my statement. I put those there hoping to make the error stand out.

[Updated on: Mon, 02 October 2006 18:00]

Report message to a moderator

Re: missing right parenthesis [message #195885 is a reply to message #195869] Mon, 02 October 2006 23:35 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
decode (trunc(sysdate) - trunc(to_date (call_date)), 1, 'red', 2, 'blue', 3, 'black') call_date3

You may also need to add a date format mask, such as:

decode (trunc(sysdate) - trunc(to_date (call_date, 'dd-Mon-rr')), 1, 'red', 2, 'blue', 3, 'black') call_date3

[Updated on: Mon, 02 October 2006 23:38]

Report message to a moderator

Re: missing right parenthesis [message #196000 is a reply to message #195885] Tue, 03 October 2006 10:10 Go to previous messageGo to next message
deongee
Messages: 8
Registered: October 2006
Junior Member
Thanks Barbara this gets rid of the error but it's not pulling any data.

I'm trying to test an if condition in portal. If the date is greater than 5 then and so on.
This is the code i'm using.


select to_char (call_date, 'MM-DD-YYYY') call_date2, status, call_num, '<b>' || clientname || '</b>' clientname, dept_code, staff_id, decode (trunc(sysdate) - trunc(to_date (call_date, 'dd-mon-rr')), 1, 'red') call_date3
from hd_call
where call_date between '01-May-06' and '02-May-07'
and staff_id = decode ('##Param1##', 'ALL', staff_id, '##Param1##')
and status = decode ('##Param2##', 'ALL', status, '##Param2##') 
and dept_code = decode ('##Param3##', 'ALL', dept_code, '##Param3##')
and not ('##Param1##' = 'ALL' and '##Param2##' = 'ALL' and '##Param3##' = 'ALL' )
Re: missing right parenthesis [message #196010 is a reply to message #196000] Tue, 03 October 2006 12:11 Go to previous messageGo to next message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
deongee wrote on Tue, 03 October 2006 11:10


where call_date between '01-May-06' and '02-May-07'
[/code]


Comparing a DATE column to a character string is sure to cause unexpected results.
Re: missing right parenthesis [message #196049 is a reply to message #196010] Tue, 03 October 2006 16:33 Go to previous message
deongee
Messages: 8
Registered: October 2006
Junior Member
Thanks Joy I've figured it out now.
Previous Topic: Where did it go
Next Topic: ora-00600;internal error code,arguments:[ktbdchk1:baddscn],[],[],[]
Goto Forum:
  


Current Time: Sat Dec 10 10:39:41 CST 2016

Total time taken to generate the page: 0.07530 seconds