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-00903 invalid table name

User_PGQWTJul 19 2016 — edited Jul 20 2016

What's wrong with this function please.  I'm getting ORA-00903: invalid table name, ORA-06512: at "CHE.F_UNAPP_COUNT10", line 24



CREATE OR REPLACE function CHE.f_unapp_count( parm_file in varchar2, parm_dist in varchar2)

  return  number is Result number(6);

  the_sql  varchar2(100);

  the_sql3  varchar2(100);

  where_clause varchar2(100);

 

the_sql:= 'select count(*) from ' || parm_file || ' into Result';

dbms_output.put_line('the_sql= '||the_sql);

where_clause  := ' WHERE dist = '''||parm_dist||'''';

dbms_output.put_line('where_clause= '||where_clause);

 

the_sql3:=' and dropped_date is null and dist_approved not in (''X'',''Y'',''y'')';

dbms_output.put_line('the_sql3= '||the_sql3);

 

execute immediate the_sql || where_clause || the_sql3;

   return(Result);

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 17 2016
Added on Jul 19 2016
12 comments
8,102 views