How to store upper characters by default? [message #300726] |
Sun, 17 February 2008 23:34 |
dr.s.raghunathan
Messages: 540 Registered: February 2008
|
Senior Member |
|
|
1. Even if i enter raghu or Raghu it should get stored as
RAGHU. How to write database trigger for storing upper(new.xxx)
2. I have one table Product where columns are as follows:
Product_code varchar2(3)
Product_qty n(10,3)
Product_price n(10,3)
Product_val n(10,3)
I wrote database trigger for storing the product_val as
product_qty * product_price. No error and enabled. It does not getting executed when i try to enter qty and price alone while inserting and as well as updating.
urs
dr.s.raghu
ta
[MERGED by LF]
[Updated on: Fri, 22 February 2008 03:31] by Moderator Report message to a moderator
|
|
|
|
|
how to store upper characters by default [message #301880 is a reply to message #300726] |
Fri, 22 February 2008 02:50 |
dr.s.raghunathan
Messages: 540 Registered: February 2008
|
Senior Member |
|
|
dear sir/madam/wizards,
for example
I have table name as emp
where id number primary key
emp_no number (5,0)
emp_name varchar2(50)
I create a page (data entry form) using Apex 3.0
Even if enter small characters (lower case) it should get stored
as upper characters. I need not on insist the user to effect
caps loack on.
I was confident that it can be tackled through database trigger
using before insert or update or delete on emp for each row
and using :new.emp_name; I have done it long back.. it is not working now. I do not know what sort of the mistake i did on creating database triggers.
yours affectionately with advanced thanks
dr.s.raghunathan
|
|
|
|
|
|
|
Re: trigger for storing upper characters [message #302787 is a reply to message #301895] |
Wed, 27 February 2008 00:43 |
dr.s.raghunathan
Messages: 540 Registered: February 2008
|
Senior Member |
|
|
Thank you sir/ madam,
I solved the problem using trigger. I just made a mistake.
I should have written the following
[code]
before insert or update on <table name>
for each row
begin
:new.cola := upper(:new.cola);
end;
instead
i have written as
before insert or update or delete on <table name>
for each row
begin
:new.cola := upper(:new.cola);
end;
[/]
Anyway thanks to the forum members who had seen my previous request. I intend to close the thread on this topic.
thank you,
yours affectionately
dr.s.raghunathan
|
|
|
|