Breaking News

Editors Picks

Tuesday, December 6, 2011

execute stored procedure in oracle without parameter

declare strlo varchar2(2000);
 BEGIN
     PRC_CREATETABLE('CHL_PRIM_SALES_KPI',strlo);
     DBMS_OUTPUT.put_line(strlo);
 end;
Read more ...

drop table if exists in oracle sql


declare tbl_exist number;
   BEGIN
        select count(*) into tbl_exist from user_tables where Upper(table_name)=Upper('test1');
        DBMS_OUTPUT.put_line(tbl_exist);
        if tbl_exist = 1 then
           EXECUTE IMMEDIATE 'drop table test1';
        end if;
   end;
Read more ...

create table from another table in stored procedure in oracle


create table from another table in stored procedure in oracle

CREATE OR REPLACE PROCEDURE PRC_CREATETABLE is
circlecode varchar2(20);
cursor  c1 is select distinct circle_code from circle_master;
BEGIN
 open c1;
  loop     
      fetch c1 into circlecode;
        EXIT WHEN c1%NOTFOUND;
       EXECUTE IMMEDIATE 'CREATE TABLE  tablename AS (SELECT *  refencetablename WHERE   circle_code='''||circlecode||''') '  ;       
end loop;
close c1;
END PRC_CREATETABLE;
Read more ...

Contact Us

Name

Email *

Message *