Format a cursor data results

  • If anyone is familiar with VB -- I am looking for something similar to vbnewline.

    I have a recordset that I need to send via email. I can retrive the data with no problems but the data has to be formated a certian way. example protion from my cursor...

    OPEN TRs

    FETCH NEXT FROM TRs

    INTO @TRno, @TRStatus, @ActivityName, @UIC, @TRTitle, @TROpenDate, @System, @Component

    WHILE @@FETCH_STATUS = 0

    BEGIN

    Select @rs = "this is atest" + @TRno + ", "

    + @TRStatus + ", " + @ActivityName + ", " + @UIC + ", " + @TRTitle + ", " + @TROpenDate + ", " + @System + ", " + @Component

    PRINT @rs

    execute SEND_REMEDY_TRS 'mail@me.com', 'mail@me.com', 'Hello World', @rs

    FETCH NEXT FROM TRs

    INTO @TRno, @TRStatus, @ActivityName, @UIC, @TRTitle, @TROpenDate, @System, @Component

    END

    The exact problem is - the results print horizantal. For each value I need a new line. Any help out there...

  • Have you tried embedding a CR/LF in the output where you want it to split e.g.

    declare @txt varchar(255)

    set @txt = 'Hello there' + char(13) + char(10) + 'this is the next line'

    print @txt

    This will show up in QA as 2 lines.

  • WOrked....Thanks..

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply