Home » SQL & PL/SQL » SQL & PL/SQL » Can the data for a view be altered using Pl/sql?
Can the data for a view be altered using Pl/sql? [message #39915] Thu, 22 August 2002 22:41 Go to next message
Anupam
Messages: 62
Registered: July 2001
Member
Hi,
I have a very peculiar requirement. I need to base a view on a couple of tables. But I need to apply some logic (using Pl/sql) on the data before populating the data in the view.
I cannot make a new table for my requirement.

Is there a way in while I can use PL/Sql in cunjuction with a View to get the desired data?

Thanks in advance.
Anupam
Re: Can the data for a view be altered using Pl/sql? [message #39916 is a reply to message #39915] Fri, 23 August 2002 04:32 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
I dont get your requirement exactly.
But u can make use of FUNCTIONS in view definitions.
Say, u can create some fucntion ( that does your logic)
and make use of it in the view defintion.
here i used the builin function COUNT
local@ >ed
Wrote file afiedt.buf

  1  create view ssd
  2  as select deptno,count(deptno) cnt from emp
  3*    group by deptno
local@ >/

View created.

Local@ >select * from ssd;

    DEPTNO        CNT
---------- ----------
        10          3
        20          5
        30          6

 

Re: Can the data for a view be altered using Pl/sql? [message #39919 is a reply to message #39916] Fri, 23 August 2002 09:57 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
http://www.orafaq.net/msgboard/sql/messages/15490.htm
Previous Topic: Tracking changes to rows in Oracle 9i
Next Topic: Is there any scheduler in oracle 8i??
Goto Forum:
  


Current Time: Thu Apr 25 11:25:56 CDT 2024