Computing.Net > Forums > Database > oracle 9i sql question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

oracle 9i sql question

Reply to Message Icon

Name: cesarNZ
Date: June 3, 2009 at 16:14:43 Pacific
OS: Windows XP
CPU/Ram: na
Product: N/a / NA
Subcategory: General
Comment:

hi all,
have a sql question. i have a table which has a column varchar2(10) which holds employee numbers e.g 'X1234'. I need to update these and change them to lower case 'x' whereever they are uppercase 'X' e.g if number in column is 'X1234' i need to update it to be 'x1234'.

i dont want to update one at a time so is there an easy way to update them all in a sql update statement ??

thanks in advance.



Sponsored Link
Ads by Google

Response Number 1
Name: kkkkkkkk1986
Date: June 3, 2009 at 17:20:26 Pacific
Reply:

You don't want to update one at a time?
It's impossiable,for the database will change it one by one wahtever the sql is.


0

Response Number 2
Name: cesarNZ
Date: June 3, 2009 at 18:06:52 Pacific
Reply:

what i meant was i dont want to hard code each 'x number ' line by line. i dont really care how the db does it i just want the sql for it.


0

Response Number 3
Name: wizard-fred
Date: June 3, 2009 at 18:33:47 Pacific
Reply:

Try using a the lower case function and and a substring function if you have to restrict the scope.


0

Response Number 4
Name: cesarNZ
Date: June 3, 2009 at 19:41:05 Pacific
Reply:

ok heres what i got so far :

update employee set number = (select lower(number) from employee where number like 'X%')

and this doesnt work since the subselect returns multiple rows.

so can someone suggest another way of doing this ??


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: oracle 9i sql question

SQL Question www.computing.net/answers/dbase/sql-question/83.html

SQL Question about DISTINCT www.computing.net/answers/dbase/sql-question-about-distinct/289.html

settings in oracle for java code www.computing.net/answers/dbase/settings-in-oracle-for-java-code/135.html