• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DBMS_SQL to create a view

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hej,
I am trying to create a view using pl/sql.
I want to create it with a trigger, procedure or a function.
My problem is that when i create the trigger or procedure i dont get any error message, but when i am executing the trigger/procedure i get "The page cannot be found" in my webbrowser.
I have created a trigger (as below) and when i am adding values to the table the trigger dosent execute.
What am i doing wrong?
The code is
CREATE OR REPLACE TRIGGER TEST_TR AFTER INSERT ON ANTAGEN
declare
v_cursor INTEGER;
v_sql varchar(250);
BEGIN
v_cursor:=DBMS_SQL.OPEN_CURSOR;
v_sql:='create or replace view test_vw as select count(*) as antal, kursid from antagen group by kursid';
DBMS_SQL.PARSE(v_cursor,v_sql,DBMS_SQL.NATIVE);
DBMS_SQL.CLOSE_CURSOR(v_cursor);
END;
or/and
CREATE OR REPLACE procedure TEST
as
v_cursor INTEGER;
v_sql varchar(250);
BEGIN
v_cursor:=DBMS_SQL.OPEN_CURSOR;
v_sql:='create or replace view test_vw as select count(*) as antal, kursid from antagen group by kursid';
DBMS_SQL.PARSE(v_cursor,v_sql,DBMS_SQL.NATIVE);
DBMS_SQL.CLOSE_CURSOR(v_cursor);
END;
Or is it possible to create a view some other way with pl/sql?
Best regards
Johan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic