How to use UPDATE command in TABLE FUNCTION with PIPELINED [message #222576] |
Mon, 05 March 2007 09:00 |
Jegathees
Messages: 8 Registered: December 2005 Location: Coimbatore
|
Junior Member |
|
|
Hi,
I have created one TABLE FUNCTION with PIPELINED option in my Oracle database. This is simple select query from table, (just 5 fields from student table). It works fine. I give below the coding.
--------------------------------------------------------
SQL>CREATE OR REPLACE FUNCTION get_all_objects
RETURN object_table_type PIPELINED AS
BEGIN
FOR cur IN (SELECT * FROM student WHERE readflag = ' ')
LOOP
PIPE ROW (object_row_type(cur.ID, cur.NAME, cur.BIRTHYEAR, cur.BIRTHMONTH, cur.READFLAG));
END LOOP;
RETURN;
END;
-------------------------------------------------------
Now, the requirement is alread some records in the table with fields readflag = ' '. We want to update readflag = 'Y' for those records. Then, commit. How will we do this?
Friends, Could you kindly give me an idea how to do this?
Thanking you.
Kind Regards,
Jegatheeswaran P.
|
|
|