Skip to Main Content

Analytics Software

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!

How to drop temporary $ tables from the schema in ODI.?

SanthoshSreshtaOct 28 2015 — edited Nov 2 2015

Hi Expertise,

I am trying to drop the $ tables which I am getting while running my Interfaces, procedures and packages.
I am using this code which i found in google.

I have created an option named tempSchema with value ODI ( My schema ) which I am working

DECLARE

V_COUNT NUMBER;

V_TABLE VARCHAR2(300);

stmt varchar2(300);

BEGIN

SELECT COUNT(DISTINCT TABLE_NAME)INTO V_COUNT FROM ALL_TABLES WHERE

OWNER='<%odiRef.getOption("tempSchema")%>'AND TABLE_NAME LIKE '%$_%';

WHILE(V_COUNT>0)LOOP

SELECT DISTINCT TABLE_NAME INTO V_TABLE FROM ALL_TABLES WHERE

OWNER='<%=odiRef.getOption("tempSchema")%>'AND TABLE_NAME LIKE '%$_%' AND ROWNUM=1;

stmt:='DROP TABLE'||'<%=odiRef.getOption("tempSchema")%>'||'-'||V_TABLE||'cascade constraints PURGE';

EXECUTE IMMEDIATE stmt;

commit;

V_COUNT:=V_COUNT -1;

END LOOP;

END;

please find the screenshot of my option

drop.png

screenshot of my procedure

drop1.png

While I am executing the procedure, I am getting Invalid SQL statement error.

Please help me in dropping the tables.

Thanks,

Santhosh.

This post has been answered by SanthoshSreshta on Nov 2 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2015
Added on Oct 28 2015
7 comments
3,166 views