Subject | Re: Splitting a field |
---|---|
Author | Alexander V.Nevsky |
Post date | 2003-05-19T19:23:45Z |
--- In ib-support@yahoogroups.com, Joe Martinez <joe@j...> wrote:
purpose. But I think it is design mistake - it is more logical and
simply to store FirstName and LastName and make WholeName computed
column.
Best regards, Alexander.
> Ok, let's say I have a table (Customers) with 3 varchar fields:to take
>
> Wholename
> Firstname
> Lastname
>
> Wholename contains names that are always in the following format:
> John Smith
> Peter Johnson
> Mary Martin
> etc...
> That is, it's always first name, space, last name.
>
> The Firstname and Lastname fields are currently empty. My task is
> the Wholename field and split it up into Firstname and Lastname andset
> them appropriately.are, based
>
> So, I basically have something like:
>
> update Customers
> set Firstname = ??????????????,
> Lastname = ?????????????
>
> I'm trying to figure out what to put in where the question marks
> on the Wholename fields. I want to do this with an SQL statement,rather
> than writing a client app or stored procedure.Joe, think about usage of existing UDFs or writing own for this
>
> Does anyone know how this can be done?
purpose. But I think it is design mistake - it is more logical and
simply to store FirstName and LastName and make WholeName computed
column.
Best regards, Alexander.