GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 16 of 166    Print  
In PL/SQL I need to get like this scenario. if I am doing manipulation on a table, I need to display a record as Non-Updateable. It need to show a message to the user. How it is possible.
Thanks in Advance.

  
Total Answers and Comments: 7 Last Update: August 12, 2008     Asked by: murthy 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 06, 2006 12:52:26   #1  
hemachandra        

RE: hi everybody! in pl/sql i need to get li...

Hi

You can write a trigger on that table or u can define a check constraint (I hope you must be having a rule on a column)


 
Is this answer useful? Yes | No
September 14, 2006 14:25:54   #2  
developer        

RE: hi everybody! in pl/sql i need to get li...

Hi Hemachander

Can u give an example.

Thanks.


 
Is this answer useful? Yes | No
February 23, 2007 19:22:21   #3  
madhuri        

RE: hi everybody! in pl/sql i need to get li...
create or replace trigger trg1
after insert or update or delete on tab1

begin

dbms_output.put_line('Changes have been made on table tab1');

end;


 
Is this answer useful? Yes | No
August 13, 2007 00:07:32   #4  
askvenki Member Since: July 2007   Contribution: 18    

RE: hi everybody! in pl/sql i need to get li...
Madhuri
This is not possible where the message will be printed if you execute
Table from another environment like Java Net. In SQL I think it is not possible.

 
Is this answer useful? Yes | No
August 29, 2007 07:41:39   #5  
ramkiibm.yerra Member Since: August 2007   Contribution: 2    

RE: In pl/sql I need to get like this scenario. if i a...
Madhuri
Its Correct but Its always recomand that you use BEFORE INSERT rather than AFTER INSERT for this situation. This Triggering Environment is applicable to any third-party application also Like JAVA..NET etc

Regds
Ramki YERRA
IBM India Pvt LTD Bangalore-71
ramakrishna . yerra @ in . ibm . com

 
Is this answer useful? Yes | No
August 11, 2008 04:17:42   #6  
SonuYadav Member Since: September 2006   Contribution: 1    

RE: In PL/SQL I need to get like this scenario. if I am doing manipulation on a table, I need to display a record as Non-Updateable. It need to show a message to the user. How it is possible.Thanks in Advance.
You can user sql rowcount to check whether the dml does something or not
eg

begin
delete from tbl_xxx
where col_yyy 'ASDF';
dbms_output.put_line (sql rowcount);
end;

this way it will return the no of rows deleted

 
Is this answer useful? Yes | No
August 12, 2008 00:18:18   #7  
rajivgupta780184 Member Since: August 2008   Contribution: 32    

RE: In PL/SQL I need to get like this scenario. if I am doing manipulation on a table, I need to display a record as Non-Updateable. It need to show a message to the user. How it is possible.Thanks in Advance.

CREATE OR REPLACE TRIGGER SHOW_BEFORE_DML
BEFORE INSERT OR DELETE OR UPDATE
ON SERVICE_ORDER_STATUS --(TABLE NAME)

FOR EACH ROW
BEGIN
DBMS_OUTPUT.PUT_LINE('NON-UPDATABLE TABLE');
ROLLBACK;
END;

Thanks
Rajiv Gupta
Yogik Technologies Pvt. Ltd.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape