Skip to Main Content

SQL & PL/SQL

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!

Ora:- 00936 Missing expersion,

NicloeiWJun 13 2007 — edited Jun 14 2007

Hi All,

I have one function which transposes rows into columns ,

SQL> CREATE OR REPLACE Function mail_sep(cur sys_refcursor,p_email Varchar2)  Return Varchar2
  2         As
  3    v_email Varchar2(1000);
  4    h_email Varchar2(1000);
  5  Begin
  6    fetch cur into v_email;
  7          v_email := ';'||v_email||';' ;
  8          FOR cur IN 1 .. LENGTH (v_email) - LENGTH (REPLACE (v_email, ';', '')) - 1
  9          Loop
 10          return (SUBSTR (v_email,INSTR (v_email, ';', 1, cur) + 1,
 11                          INSTR (v_email, ';', 1, cur + 1) - INSTR (v_email, ';', 1, cur) - 1));
 12          End Loop;
 13    Close cur;
 14  End;
 15  /

Function created

But when i do the select i receive the following error

SQL> CREATE TYPE mail As Table Of Varchar2(200);
  2  /

Type created

Select  table(Cast(mail_sep(Cursor('X;Y;Z;A')) As mail)) From dual

ORA-00936: missing expression

Dont understand where i am going wrong please help me

Regards
Nic

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2007
Added on Jun 13 2007
5 comments
485 views