how to get return value and cursor using ct_results() for Store procedure

Posted on 2006-05-04
Last Modified: 2012-05-05
I am using Sybase 15.0 version on Windows operating system. From C++ code using Sybase Client library I am executing a stored procedure.  

Say this is my stored procedure that I am invoking.

create procedure abc
select name, sal from employee
return 1

I am using ct_results() to get the result type, For the stored procedures which are not returning any rows, Result type is coming as CS_STATUS_RESULT, but for stored procedures which are retuning me some result set eg. Mentioned abc stored procedure where select statement returns some rows, result type is always coming as CS_ROW_RESULT.

I went through the link

After searching for ct_result, I found some sample code; I could not get much help from there.

Can anyone please let me know using Sybase client library, how I can get return value from a stored procedure returning some rows?
Question by:somasekhar
    1 Comment
    LVL 14

    Accepted Solution

    I recommend you to look at - there's quite detailed manual on handling results that you get from Sybase server.

    Your procedure is returning 2 results - one is CS_ROW_RESULT, second CS_STATUS_RESULT. Basically you keep calling ct_results until you process all of results, that your command returned.

    You may also want to look at sample code delivered with your Sybase Client - usually in %SYBASE/%SYBASE_OCS/sample - try firstapp.c

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    At the beginning of the year, the IT world was taken hostage by the shareholders of LogMeIn. Their free product, which had been free for ten years, all of the sudden became a "pay" product. Now, I am the first person who will say that software maker…
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now