I will give that a try and see if it works better.

Thanks

Dan 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of James
Bentley
Sent: Wednesday, November 04, 2009 2:30 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: space in zipcode

If this is a temporary table why not create it with a computed column
defined as:
((SGET(zipcode,3,1)) & (SGET(zipcode,3,4))) thus as you load the temp table
you are also create the separated field then you ust move the computed
column into the permanent table.

Note the simplified coding suggest by other posters instead of your original
code
((SGET(zipcode,3,1)) + ' ' + (SGET(zipcode,3,4))) 

 Jim Bentley
American Celiac Society
[email protected]
tel: 1-504-737-3293



----- Original Message ----
From: Doug Hamilton <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Wed, November 4, 2009 2:42:16 PM
Subject: [RBASE-L] - Re: space in zipcode

How about using a temp table with 2 columns for the ZIP code - a Before and
After:
PROJECT TEMPORARY ZIPTable from tmpdealerlocator using DealerID,zipcode Add
a NewZIP text column to ZIPTable.
UPDATE ZIPTable set NewZIP = ((SGET(zipcode,3,1)) & (SGET(zipcode,3,4)))
UPDATE tmpdealerlocator SET ZIPCODE = (NewZIP) +
  From  tmpdealerlocator T1, ZIPTable T2 + WHERE T1.DealerID = T2.DealerID
You might need an index on ZIPTable.DealerID if it's slow.
Doug

Dan Goldberg wrote:
> I have data that I receive from a vendor for canadian zipcodes and 
> need to put a space after the first three characters.
>
> V0R1R1
>
> Need to be
>
> V0R 1R1
>
> So I run the command:
>
> UPDATE tmpdealerlocator SET zipcode = +
>  ((SGET(zipcode,3,1)) + ' ' + (SGET(zipcode,3,4))) +  WHERE zipcode IS 
> NOT NULL
>
> It runs buts takes forever to put the spaces in it.
>
> Does anyone have a suggestion to make it run faster??
>
> TIA
>  
>
>
> Dan Goldberg
>
>
>
>  


      


Reply via email to