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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, 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.




Response Number 1
Name: kkkkkkkk1986
Date: June 3, 2009 at 17:20:26 Pacific
+1
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.



Response Number 2
Name: cesarNZ
Date: June 3, 2009 at 18:06:52 Pacific
+1
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.



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

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



Response Number 4
Name: cesarNZ
Date: June 3, 2009 at 19:41:05 Pacific
+1
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 ??



Reply to Message Icon

Related Posts

See More


Rpair corrupt file opening and reading a st...


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Google Ads



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