Results 1 to 5 of 5

Thread: Adding '/'

  1. #1
    Join Date
    Jun 2008
    Location
    India
    Posts
    96

    Unanswered: Adding '/'

    Hi All,

    I have one senario.

    create table Email_ID
    (
    CustomerID varchar(30),
    Address varchar(50)
    )

    insert into Email_ID
    SELECT 'HK08012698','edxxxxx@gmail.com' UNION ALL
    SELECT 'HK08012698','kimxxxx@gmail.com' UNION ALL
    SELECT 'HK08012698','yunxxxx@hotmail.com' UNION ALL
    SELECT 'HK08012699','sallyxx@gmail.com' UNION ALL
    SELECT 'HK08012699','joexxxx@gmail.com' UNION ALL
    SELECT 'HK08012697','yangxxx@hotmail.com' UNION ALL
    SELECT 'HK08012700','ed1xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed2xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed3xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed4xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed5xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed6xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed7xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed8xxxx@gmail.com' UNION ALL
    SELECT 'HK08012700','ed9xxxx@gmail.com'


    Declare @Add varchar(255)
    select @Add = ''
    select @Add = @Add +Address
    from Email_ID
    where CustomerID = 'HK08012698'
    select @Add

    Current output is :

    edxxxxx@gmail.comkimxxxx@gmail.comyunxxxx@hotmail. com

    But my requirement is

    edxxxxx@gmail.com/kimxxxx@gmail.com/yunxxxx@hotmail.com

    i want to insert or add '/' symbol after the word '.com'.

    Any help would be appreciable !

  2. #2
    Join Date
    Jun 2008
    Location
    India
    Posts
    96
    ooooops.....

    i did a small modification in the code.

    Declare @Add varchar(255)
    select @Add = ''
    select @Add = @Add +Address+ '/'
    from Email_ID
    where CustomerID = 'HK08012698'
    select @Add

    It is working.

  3. #3
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    You running on a very old ASE version?
    Don't expect similar behavior on newer versions
    Although there is a trace flag to get the old behavior
    Don't depend on it.

  4. #4
    Join Date
    Jun 2008
    Location
    India
    Posts
    96
    I am using 12.0.

  5. #5
    Join Date
    Sep 2004
    Posts
    7
    Place characters with special meaning to the shell (the command prompt in Windows), such as the backslash (\), asterisk (*), slash (/), and spaces, in quotes. You can precede some special characters with the backslash (\) to “escape” them. This prevents the shell (command prompt) from interpreting the special characters.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •