Re: substring update?

From: Uri Dimant (urid_at_iscar.co.il)
Date: 03/24/05


Date: Thu, 24 Mar 2005 11:23:12 +0200

Hi
DECLARE @Var VARCHAR(30)
SET @Var='UK AB10'
SELECT REPLACE(@Var,'UK'+SPACE(1),'GED')

"marcmc" <marcmc@discussions.microsoft.com> wrote in message
news:FCDDC9E0-DC99-4A90-8A4B-D55975236012@microsoft.com...
> I have...
>
> Po_rd_postcode_id
> -----------------
> UK AB10 2 spaces between UK and AB10
>
> I want to update it to...
>
> Po_rd_postcode_id
> -----------------
> GED AB10 1 space between GED and AB10
>
> I was hoping to use...
>
> Update POt_lu_rd_post_code
> set substring(Po_rd_postcode_id,1,4) = 'GED '
> WHERE Po_rd_postcode_id = 'UK AB10'
>
> But it looks like substring in the set criteria won't work.
> Any ideas how I can do this?
>
>
>



Relevant Pages

  • Re: function pointers vs direct calling in javascript
    ... scope tree to look for 'tempVar2' or for some other reason? ... Here is what I think of 'var', correct me if I am wrong. ... 'var' doesn't as such declare a variable. ... a property of the global object when the code executes. ...
    (comp.lang.javascript)
  • Re: MDIForm Parent/Child forms BEST Practice
    ... First i always create a public var of my main form (mdi parent) for easy ... access (yust declare it in a module and i the parent.load set the var to me) ... Private Sub frmMain_Closed(ByVal sender As Object, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Library not opening...?
    ... once in form's var section and once in method, ... In Form's Init you open and assing global variable, ... declare variables in form's var section ... > Form's Var block, and opened only in the Form's Init. ...
    (comp.databases.paradox)
  • Re: perl feature request
    ... basically, if the var is not set, it sets the ... but you can't declare and also optionally assign. ... they're not useless because they keep their value from one call to ... while still being lexical variables. ...
    (comp.lang.perl.misc)
  • Re: How much would variable declarations in Ruby make you wince?
    ... languages that require variables to be declared or typed. ... How on God's green Earth are you going to accidentally prepend an ... only happen if you accidentally want to declare a new variable. ... until "var" is the norm; ...
    (comp.lang.ruby)