17,086
社区成员
发帖
与我相关
我的任务
分享
Ok, got it working as SQL. My select now looks like this:
SELECT JOB_ID,
STRAGG (DISTINCT LOCATION),
STRAGG (DISTINCT AREA),
STRAGG (DISTINCT DISTRICT)
FROM T
GROUP BY JOB_ID.
Problem I have is that this does not seem to work inside a PL/SQL Block. I get the error
ORA-06550: line 15, column 47:
PL/SQL: ORA-30482: DISTINCT option not allowed for this function
ORA-06550: line 12, column 4:
PL/SQL: SQL Statement ignored
Is there a different way to do the distinct? I thought maybe inside the ODCIAGGREGATEMERGE
function, but I could not figure out how.
Thanks.
Followup July 28, 2003 - 10am Central time zone:
Interesting, looks like a "product issue" to me. use a dynamically opened ref cursor as a
temporary solution:
variable x refcursor
declare
l_cursor sys_refcursor;
begin
open l_cursor for '
SELECT JOB_ID,
STRAGG (DISTINCT LOCATION) l,
STRAGG (DISTINCT AREA) a,
STRAGG (DISTINCT DISTRICT) d
FROM T
GROUP BY JOB_ID';
:x := l_cursor;
end;
/
print x
(please file an issue with support as well!)