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