Instead of Using Cursor? Other Ways?

  • Pockeyfan,

    HK08012700

    ed1xxxx@gmail.com/ed2xxxx@gmail.com/ed3xxxx@gmail.com/ed4xxxx@gmail.com/ed5xxxx@gmail.com/ed6xxxx@gmail.com/ed7xxxx@gmail.com/ed8xxxx@gmail.com/ed9xxxx@gmail.com

    I got the above output.

    karthik

  • exec Email_ID_display 'HK08012698'

    Result:

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

    karthik

  • pockeyfan (8/18/2008)


    Hi, karthikeyan, thanks

    However, I could only get the " ed9xxxx@gmail.com" with your codes...

    Did you try the function I gave you?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • karthikeyan (8/18/2008)


    exec Email_ID_display 'HK08012698'

    Result:

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

    It's strange that I could only get "/yunxxxx@hotmail.com" with exactly the same code as you...

    Well, I'm using Sybase 10 and Embarcadero DBArtisan 8.1.2, maybe Sybase 10 does not support to store all the E-mail addresses??

  • Did you try the function I gave you?

    Hi, thanks for your help

    However, I could not run your codes in my system. There's always error message shown "Incorrect syntax near the keyword 'BEGIN' "

    I searched onlined and found the "CREATE FUNCTION" statement is Not supported by Adaptive Server Enterprise which I'm using now:

    http://manuals.sybase.com/onlinebooks/group-iq/iqg1250e/iqref/@Generic__BookTextView/47129;pt=46991

  • Well, I'm using Sybase 10 and Embarcadero DBArtisan 8.1.2, maybe Sybase 10 does not support to store all the E-mail addresses??

    ok. Why you still using sybase 10 ? Why can't ask your manager to upgrade it to 15.2(latest version) or atleast 12.5.3 ( which is having lot of features comparing to Sybase 10) ?

    Coming back to your requirement, As of my knowledge Sybase 10 dooesn't support Functions.

    Are you using SQLADVANTAGE also?

    If yes, try on that and let me know.

    karthik

  • ok. Why you still using sybase 10 ? Why can't ask your manager to upgrade it to 15.2(latest version) or atleast 12.5.3 ( which is having lot of features comparing to Sybase 10) ?

    I tried on Adaptive Server Enterprise/12.5.4, it still did not support Create Function...

    Are you using SQLADVANTAGE also?

    No, there's no SQLADVANTAGE on my computer. We'll use Embarcadero DBArtisan...

  • There is a real difference when running a concatenating code in SQL Server 2000 and SQL Server 2005.

    SQL Server 2005 displays the "erratic" behaviour you describe such as only returning last record.

    But there is a workaround for that too.


    N 56°04'39.16"
    E 12°55'05.25"

  • pockeyfan (8/19/2008)


    Did you try the function I gave you?

    Hi, thanks for your help

    However, I could not run your codes in my system. There's always error message shown "Incorrect syntax near the keyword 'BEGIN' "

    I searched onlined and found the "CREATE FUNCTION" statement is Not supported by Adaptive Server Enterprise which I'm using now:

    http://manuals.sybase.com/onlinebooks/group-iq/iqg1250e/iqref/@Generic__BookTextView/47129;pt=46991

    Heh... that would be lessons #2 and #3.... SQL is not SQL everywhere and SyBase isn't the same as SQL Server anymore. 😉

    Sorry I can't help in SyBase cuz I can't test a solution. I recommend you try a SyBase forum mostly because of the differences that now exist.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 9 posts - 16 through 23 (of 23 total)

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