Home » Developer & Programmer » Forms » cursor & decode & supquery .. error? (error in statment .)
cursor & decode & supquery .. error? [message #460735] Mon, 14 June 2010 05:47 Go to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
what's wronge in this code :

cursor cur_requests is
SELECT request_id, request_date,
       decode (wh_request_info.request_kind,'ÅÏÇÑÉ',[b](SELECT department_name FROM hr_departments WHERE department_id = wh_request_info.request_who_id and rownum = 1)[/b] ,site_name),
       emp_first_name || emp_all_name AS namess
  FROM hr_emp_info, wh_request_info, hr_sites_info
 WHERE (hr_emp_info.emp_id = wh_request_info.emp_id)
   AND (wh_request_info.request_who_id = hr_sites_info.site_id)
   AND request_date = '02/01/2010';


when am try to compile this code error raise at start and end of the bold code ( sub query) why this error .. ?

thanks
Re: cursor & decode & supquery .. error? [message #460738 is a reply to message #460735] Mon, 14 June 2010 05:50 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
What's the exact error message?
Re: cursor & decode & supquery .. error? [message #460741 is a reply to message #460735] Mon, 14 June 2010 05:58 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
this is ..
  • Attachment: err.GIF
    (Size: 95.27KB, Downloaded 587 times)
Re: cursor & decode & supquery .. error? [message #460744 is a reply to message #460741] Mon, 14 June 2010 06:11 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Can you run that select statement in sqlplus without error?
Re: cursor & decode & supquery .. error? [message #460748 is a reply to message #460744] Mon, 14 June 2010 06:15 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
am try it in Toad and it's working v.good

and in sql plus .. it's working v.good .. !!!

i don't know what happen ..
Re: cursor & decode & supquery .. error? [message #460754 is a reply to message #460748] Mon, 14 June 2010 06:27 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Forms obviously doesn't recognize the syntax - are you using forms 6i?

Try creating a view in the db that is the current select statement. Then change your cursor to select from the view.
Re: cursor & decode & supquery .. error? [message #460755 is a reply to message #460748] Mon, 14 June 2010 06:31 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is Forms 6i, right? If so, Id say that Forms PL/SQL engine doesn't support such a use of a subquery. Which also means that you'll have to rewrite the query.

P.S. Ah, phone call lasted too long (which prevented me to post a reply); CM was way faster, but - it appears that our opinions match.

[Updated on: Mon, 14 June 2010 06:32]

Report message to a moderator

Re: cursor & decode & supquery .. error? [message #460756 is a reply to message #460755] Mon, 14 June 2010 07:07 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
no .. am using forms 10g
Re: cursor & decode & supquery .. error? [message #460757 is a reply to message #460756] Mon, 14 June 2010 07:18 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then I really don't understand the error.
Never the less my suggestion of creating a view should fix the issue.
Re: cursor & decode & supquery .. error? [message #460833 is a reply to message #460757] Tue, 15 June 2010 02:43 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
view may be fix .. but the problem if i made view i wan to pass ever time new date !! not fixed date ..

this mean i can't pass date to view ..i need procedure
Re: cursor & decode & supquery .. error? [message #460834 is a reply to message #460833] Tue, 15 June 2010 02:57 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You'd do that with the WHERE clause, such as
where view.date_column = to_date('15.06.2010', 'dd.mm.yyyy')
Re: cursor & decode & supquery .. error? [message #460844 is a reply to message #460834] Tue, 15 June 2010 03:53 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
The where clause of the cursor to be absolutely clear.
Re: cursor & decode & supquery .. error? [message #464260 is a reply to message #460844] Wed, 07 July 2010 02:55 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Did this suggestion solve your problem?

David
Previous Topic: 2 type of different errors
Next Topic: Sending Email with attached files
Goto Forum:
  


Current Time: Fri Sep 20 04:51:53 CDT 2024