Home » SQL & PL/SQL » SQL & PL/SQL » change data to lower
change data to lower [message #219583] Thu, 15 February 2007 01:11 Go to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
hi
how can i change the data in column=name table=user from initcap to lower for all the tables one table is has primary and related tables
thanxs
Re: change data to lower [message #219584 is a reply to message #219583] Thu, 15 February 2007 01:15 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
If the column you want to change is not a key column, a simple update would do:
update yourtable 
set    yourcolumn = lower(yourcolumn)


MHE
Re: change data to lower [message #219597 is a reply to message #219584] Thu, 15 February 2007 01:45 Go to previous messageGo to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
thanxs
but i need to change all the table data which r related or refered
eg pk_name_id is refred in table connection column=fk_name_id
i need to change this also do i need to manully find each and every relation and change or update
cant i change where every pk_name_id is refered
thanxs

Re: change data to lower [message #219602 is a reply to message #219597] Thu, 15 February 2007 02:03 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Do you want this because you ran out of capitals? (Your messages will be better readable if you use capitalisation where needed).

Disable your constraints prior to the updates.
Re: change data to lower [message #219605 is a reply to message #219602] Thu, 15 February 2007 02:11 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
And, as a note, verify that there are no duplicates as a result of your update!

MHE
Re: change data to lower [message #219608 is a reply to message #219602] Thu, 15 February 2007 02:37 Go to previous message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
hi
1.i want to disable all table that has constraint TBL_USER_PK
ALTER TABLE tablename
DISABLE CONSTRAINT 'TBL_USER_PK';
SELECT TABLE_NAME,OWNER,CONSTRAINT_NAME FROM USER_CONSTRAINTS
WHERE R_CONSTRAINT_NAME='TBL_USER_PK'
2.then update all data to lower in all the table which column has this constraints
3.finally enable the constarints

we can use or join
select * from user_cons_columns
where constraint_name ='TBL_USER_PK'
thanxs

[Updated on: Thu, 15 February 2007 02:39]

Report message to a moderator

Previous Topic: find related table
Next Topic: tuining sqlquery
Goto Forum:
  


Current Time: Fri Dec 09 23:16:21 CST 2016

Total time taken to generate the page: 0.10712 seconds