Link to home
Start Free TrialLog in
Avatar of gladstonesheeba
gladstonesheeba

asked on

Pl/SQL query---

hi currently i have a table with columns  and data's like this
product_key        product_no              location_code

11223                  11223                        LSB

but i want to update the product_key data's to be 11223-LSB . could you please send me the pl/sql query to update . there are some 384 records with the wrong data .  i tried like this

update table set product_key=replace(product_key,product_no,'-LSB')  

but its updating the product_key as just -LSB not with the numbers. please give me a solution
Avatar of Jinesh Kamdar
Jinesh Kamdar
Flag of India image

UPDATE table SET product_key = product_key || location_code;
Sorry, use this : UPDATE table SET product_key = product_no || location_code;
Make sure that product_key is a CHAR / VARCHAR field and not a purely NUMERIC field.
ASKER CERTIFIED SOLUTION
Avatar of Jinesh Kamdar
Jinesh Kamdar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gladstonesheeba
gladstonesheeba

ASKER

THANK YOU SO MUCH
Glad to be of help :)