PL/SQL (MOSC)

MOSC Banner

Creating single table having multiple schema data

in PL/SQL (MOSC) 16 commentsAnswered

Hi All,

I am trying to create single sql statement where I am trying to re call all catalog database schema and give output as one.

But the same is failing with multiple errors.

Can anyone help here to integrate the same.





-- Add table logic as a separate transaction


declare cnt number;


begin

  -- check if the temp table exists, otherwise, create one

  select count(*) into cnt from all_tables where table_name = 'PRIVS_TBL' and owner = 'DBADMIN';


  if cnt = 1 then

    EXECUTE IMMEDIATE ('drop table dbadmin.privs_tbl');

  end if;


  EXECUTE IMMEDIATE ('CREATE TABLE privs_tbl

            (

             session_key VARCHAR2(250),

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center