| | |
trigger help pls....!!!!
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2009
Posts: 27
Reputation:
Solved Threads: 0
hello ,
(begginer of SQL)
i have to make one pro. in which
i have to use trigger which will fire before inserting into table
and convert the name into upper case but i don't what is the prob.
with the code pls provide ur suggetion
my table attributes are
stu (sno number(6),sname varchar(12),class varchar(12) );
(begginer of SQL)
i have to make one pro. in which
i have to use trigger which will fire before inserting into table
and convert the name into upper case but i don't what is the prob.
with the code pls provide ur suggetion
my table attributes are
stu (sno number(6),sname varchar(12),class varchar(12) );
Oracle Syntax (Toggle Plain Text)
CREATE OR REPLACE TRIGGER trg27 before INSERT ON stu FOR each ROW DECLARE sname1 stu.sname%TYPE; sno1 stu.sno%TYPE; class1 stu.class%TYPE; BEGIN sno1:=:NEW.sno; sname1:=:NEW.sname; sname1:=UPPER(sname1); class1:=:NEW.class; EXCEPTION WHEN OTHERS THEN dbms_output.put_line('Error is occured..!!'); INSERT INTO stu VALUES(sno1,sname1,class1); END;
0
#2 Oct 13th, 2009
Try using select into
sql Syntax (Toggle Plain Text)
SELECT :NEW.sno, UPPER(:NEW.sname), :NEW.class INTO sno1, sname1, class1 FROM dual;
Last edited by cgyrob; Oct 13th, 2009 at 6:39 pm.
•
•
Join Date: Mar 2009
Posts: 27
Reputation:
Solved Threads: 0
0
#3 Oct 14th, 2009
•
•
•
•
Try using select into
sql Syntax (Toggle Plain Text)
SELECT :NEW.sno, UPPER(:NEW.sname), :NEW.class INTO sno1, sname1, class1 FROM dual;
my query is , it's not convert the lower case into upper case
i have tried this code also but still the result is same !!!
0
#4 Oct 14th, 2009
Really not sure why upper() is not working for you.
Maybe trying using the upper() function on the insert.
Maybe trying using the upper() function on the insert.
sql Syntax (Toggle Plain Text)
INSERT INTO stu VALUES(sno1,UPPER(sname1),class1);
0
#6 Oct 14th, 2009
try assigning to a variable then select into
sql Syntax (Toggle Plain Text)
sname1 stu.sname%TYPE; sname1:= :new.sname SELECT :NEW.sno, UPPER('sname1'), :NEW.class INTO sno1, sname1, class1 FROM dual;
Last edited by cgyrob; Oct 14th, 2009 at 11:06 am.
![]() |
Similar Threads
- windows xp installation error!! pls help! (Troubleshooting Dead Machines)
- Help me remove Online Poker Pop up pls (Viruses, Spyware and other Nasties)
- hi friends pls help me out (C++)
- pls.help me im begging you!!! (C)
- pls... i need help!!! (C)
- Pls Hlp me with Hijackthis log file. (Viruses, Spyware and other Nasties)
- Pls help with my HJT log (Viruses, Spyware and other Nasties)
- can somebody pls. help me out with my HJT log.. (Viruses, Spyware and other Nasties)
Other Threads in the Oracle Forum
- Previous Thread: subtract 2 column value
- Next Thread: INSERT sql statement for DateTime
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho





