Skip to Main Content

Japanese

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

collect関数を使用すると、エラー(ORA-00932)が発生する

981537Dec 24 2012 — edited Dec 25 2012
【環境】
OS: Windows 2008 Server R2(64bit)
Oracle: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

【現象】
collect関数使用時にデータ型の不一致エラーが発生します。
collect関数の使用方法については下記のページを参考にしました。
http://docs.oracle.com/cd/E16338_01/server.112/b56299/functions031.htm

問題の解決方法、ヒント等をいただけましたら幸いです。
よろしくお願いいたします。

○エラーが発生するSQL
select cast(collect(row1) as type_varchar2_collection) as val
from (
select 'A' row1 from dual
union all
select 'B' row1 from dual
union all
select 'C' row1 from dual
);

○エラーメッセージ
行1でエラーが発生しました。:
ORA-00932: データ型が一致しません: -が予想されましたが-です。

○事前登録が必要な型の定義(こちらはエラーなくコンパイルできます)
create or replace
type type_varchar2_collection as table of varchar2(4000);
/
This post has been answered by asahide on Dec 24 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 22 2013
Added on Dec 24 2012
2 comments
4,027 views