Solved

Problem fetching data from sybase using embedded SQL

Posted on 2004-09-06
5
1,243 Views
Last Modified: 2008-01-09
Hi Everybody,

I am using Embedded SQL (OCS) with sybase 12.5 on windows platform. My application calls the functions of dll which connects and fetches the data. We used to open the connection once and later use the same connection for further interaction with the Database.

Every time caller function gives the new query.

I am able to fetch the data for first time and later it fails over PREPARE Statment (EXEC SQL PREPARE Stmt0 FROM :sql_cmd;).  Below is the error which is coming up:

SQLCODE = -33620275
---> cs_objects: cslib user api layer: external error: ZZZZZ cs_objects: error performing requested operation.

The following is the piece of code of that function:
        EXEC SQL ALLOCATE DESCRIPTOR output_desc0 WITH MAX 256;
        EXEC SQL PREPARE Stmt0 FROM :sql_cmd;
        EXEC SQL DECLARE Cursor0 CURSOR FOR Stmt0;
        EXEC SQL OPEN Cursor0 USING SQL DESCRIPTOR output_desc0;
        EXEC SQL DESCRIBE OUTPUT Stmt0 USING SQL DESCRIPTOR output_desc0;
        EXEC SQL GET DESCRIPTOR output_desc0 :output_count = count;
        EXEC SQL FETCH Cursor0 INTO SQL DESCRIPTOR output_desc0;
        EXEC SQL GET DESCRIPTOR output_desc0 VALUE :index
                   :sr_data = DATA;
       EXEC SQL CLOSE Cursor0;      
       EXEC SQL DEALLOCATE DESCRIPTOR output_desc0;
       EXEC SQL DEALLOCATE PREPARE Stmt0;
 

Kindly Help me to take out from this problem?

Thanks in Advance,
Deepak
0
Comment
Question by:deepakg76
5 Comments
 
LVL 2

Expert Comment

by:mansoor_a_khan
ID: 12015342
Deallocating cursor Cursor0, shud do also check that :sql_cmd is not NULL.

cheers
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 12017134
Please maintain your open questions:

08/27/2004 20 Fetching a text and image data from Syba...  Open Sybase
07/15/2004 20 characterset of the database (DB2, infor...  Open IBM UDB
07/23/2003 125 sub group & nested group  Open Lotus Notes/Domino
07/23/2003 250 sub group & nested group  Open Lotus Notes/Domino
07/23/2003 200 Lotus notes-Directory assistance  Open Lotus Notes/Domino
07/23/2003 200 offline or online storage  Open Lotus Notes/Domino
0
 

Author Comment

by:deepakg76
ID: 12041486
Thanks for your suggestions.

:Sql_cmd is having a proper pointer value.
Moreover, If I open the new connection for every SQL command and closes it after fetching the data. My application works properly.

I think this problem is related to the connection. can you guide where I am wrong.

The following is code to open a connection:
    EXEC SQL CONNECT :uid IDENTIFIED BY :passwd USING :connect_str ;
    EXEC SQL USE :database_name;

Thanks In Advance!
Deepak
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12280246
PAQed, with points refunded (20)

Computer101
E-E Admin
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Code not seeing ODBC driver for Sybase 1 1,070
Sybase initialize new disk in Solaris 10 failed 2 948
SyBase SQL Syntax 7 320
surrogate key in database world 6 86
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
Some of the SEO trends we might expect in 2017.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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