Solved

Problem fetching data from sybase using embedded SQL

Posted on 2004-09-06
5
1,261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Gain an elementary understanding of Blockchain technology.
This article outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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