Home » Developer & Programmer » Reports & Discoverer » Cursor Problem (Reports Builder 6.0 , Windows XP)
Cursor Problem [message #525401] Sun, 02 October 2011 08:46 Go to next message
Kittiwake
Messages: 1
Registered: October 2011
Junior Member
Hello ,

I have a complex query that i have designed and ran it using SQL-Plus ...the query just works fine ... when i plug it in as a cursor (inside a formula column) , the formula simply doesn't compile and raise an error that something expected before Select statement ...

I have divided my query to several parts to know what part doesn't compile and i have figured out that when i multiply two select statements , this doesn't work inside the formula column ...

for sake of simplicity assume the following query :

Select (Select 1 from dual) * (Select 2 from dual) From dual;

The query works fine in sql plus while not running as a cursor ...

Any one would know what could be the reason for that ?

Any help would be appreciated
Re: Cursor Problem [message #525411 is a reply to message #525401] Sun, 02 October 2011 12:30 Go to previous message
Littlefoot
Messages: 21546
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Reports' PL/SQL engine is different than your database's one (usually it means that not all functionalities that work in a database work in Reports), so I suppose that's the case in your case.

Anyway, that's easy to resolve - store result of each SELECT statement into a local variable, multiply these variables and return the result. Something like
  l_one number;
  l_two number;
begin
  select 1 into l_one from dual;
  select 2 into l_two from dual;

  return (l_one * l_two);
end;
Previous Topic: find out last page number
Next Topic: one report two pages
Goto Forum:
  


Current Time: Mon Mar 30 00:54:11 CDT 2020