Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Location
    India
    Posts
    96

    Unanswered: String Concatenation

    All,

    I have one issue which is related to sybase version.

    Really it is eating my brain.

    create table #emp
    (
    name varchar(25)
    )

    insert into #emp
    select 'karthik'
    union
    select 'anu'
    union
    select 'kavi'
    union
    select 'raj'
    union
    select 'meera'

    now i want to concatenate the above input as below

    karthik,anu,kavi,raj,meera

    so i have written the below query

    declare @s varchar(100)
    select @s = ''
    select @s = @s + name
    from #emp

    Output:

    Sybase 12.0 :

    anurajkavimeerakarthik

    sybase 12.5.4:

    karthik

    so both version is not giving the expected result set.

    I don't want to use CURSOR or WHILE LOOP

    why it is not working ?
    But i tested the same code in sql200, it was working fine in sql2000.

    so shall i say it as the drawback of sybase product ?

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Does your version of Sybase support the list() function?
    If so this thread may help.

  3. #3
    Join Date
    Jun 2008
    Location
    India
    Posts
    96
    List() - Not supported in Adaptive Server Enterprise.

    so i think any of the sybase version don't support this function.

Posting Permissions

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