Tuesday 4 April 2017

Create View Using Execute Immediate

DECLARE
      l_string           VARCHAR2 (32767);
      viewname       VARCHAR2 (30);
      objectid           NUMBER;
      P_OBJ_ID      NUMBER:=100150;
BEGIN
      viewname := 'XX_REPORT_V_' || P_OBJ_ID;
      objectid := P_OBJ_ID;
      l_string :=
            'CREATE OR REPLACE VIEW '
         || viewname
         || ' AS SELECT (OBJ_OBJECT_SQL1||OBJ_OBJECT_SQL2||OBJ_OBJECT_SQL3) AS          SQL_QUERY '
         || ' FROM EUL5_OBJS WHERE obj_id ='''
         || objectid
         || '''';

      EXECUTE IMMEDIATE l_string;
COMMIT;
END;

Your's
Amar Alam

5 comments:

Mahalya sree said...

Your thinking toward the respective issue is awesome also the idea behind the blog is very interesting which would bring a new evolution in respective field. Keep update more information.
Interior Designers in Chennai

Aashi siva said...

I must thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal blog now..
Ethical Hacking Training in Chennai
Growth Hacking Training in Chennai

Unknown said...

Regards
Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at sridevikoduru@oracleappstechnical.com | +91 - 9581017828.

Unknown said...

Information very useful.

BIGDATA Training in Chennai

Eva.William said...
This comment has been removed by the author.

Post a Comment