irodov
asked on
a sybase sql help please
Hi experts,
would appreciate help with a sql
I need to write a sybase sql which does the following,
It should look for a value in the column and if it starts with V1XXXXX -- it should change to PNXXXXX
Can you kindly help me with this,
Thanks,
would appreciate help with a sql
I need to write a sybase sql which does the following,
It should look for a value in the column and if it starts with V1XXXXX -- it should change to PNXXXXX
Can you kindly help me with this,
Thanks,
ASKER
is this a sybase function STUFF???
what does this do?
what does this do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're in luck; this is an easy one.
UPDATE YourTable
SET YourColumn = STUFF(YourColumn,1,2,'PN')
WHERE YourColumn LIKE 'V1%'
The % wild card matches any number of characters including 0. If you want to specifically change just the rows with 5 characters after the V1, change it to.....
LIKE 'V1_____'
using 5 underscores which are the single character wild card.
Regards,
Bill