Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Problem fetching data from sybase using embedded SQL

Posted on 2004-09-06
5
Medium Priority
?
1,278 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
What monsters are hiding in your child's room? In this article I will share with you a tech horror story that could happen to anyone, along with some tips on how you can prevent it from happening to you.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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