Home » Other » Training & Certification » How to store upper characters by default?
How to store upper characters by default? [message #300726] Sun, 17 February 2008 23:34 Go to next message
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

Re: trigger for storing upper characters [message #300747 is a reply to message #300726] Mon, 18 February 2008 00:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1. What about showing us what you tried?
2. What about showing us what you tried?

Before, please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel

Re: trigger for storing upper characters [message #300793 is a reply to message #300726] Mon, 18 February 2008 02:44 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Isn't it obvious? If you want to store characters in UPPER case, which Oracle function will you use?

As of the second question: what kind of a trigger is it? Did you commit the changes in order to make them visible to another session(s) (if that's how you are testing it)? Whichever it is, it seems that you'll have to share the code with us.
how to store upper characters by default [message #301880 is a reply to message #300726] Fri, 22 February 2008 02:50 Go to previous messageGo to next message
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: how to store upper characters by default [message #301883 is a reply to message #301880] Fri, 22 February 2008 02:53 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
can you post that trigger along with the error message.


regards,
Re: how to store upper characters by default [message #301884 is a reply to message #301880] Fri, 22 February 2008 02:57 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
People have already tried to help you. Why start a new thread?
here
Re: trigger for storing upper characters [message #301888 is a reply to message #300793] Fri, 22 February 2008 03:03 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
thank you very much sir,

right now i do not have triggers code since i was trying to use my office environment to get clearing my doubts.

further i am not understanding what does it mean by new thread?

yours

dr.s.raghunathan
Re: trigger for storing upper characters [message #301895 is a reply to message #301888] Fri, 22 February 2008 03:34 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
dr.s.raghunathan
i am not understanding what does it mean by new thread?

It means that you should continue discussion about use of uppercase letters in the same thread you've already opened. Do not flood the forum with the same question all over again. These two have been merged.
Re: trigger for storing upper characters [message #302787 is a reply to message #301895] Wed, 27 February 2008 00:43 Go to previous messageGo to next message
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

Re: trigger for storing upper characters [message #302793 is a reply to message #302787] Wed, 27 February 2008 00:50 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is no :new in case of delete.
This leads to an error.

Regards
Michel
Previous Topic: Who can recommend a decent Oracle 10g Starter Book
Next Topic: Defintion,use,restriction with execute immediate?
Goto Forum:
  


Current Time: Fri Apr 26 05:10:23 CDT 2024