Solved

Problem fetching data from sybase using embedded SQL

Posted on 2004-09-06
5
1,215 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
A Short Story about the Best File Recovery Software – Acronis True Image 2017
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

17 Experts available now in Live!

Get 1:1 Help Now