?
Solved

Problem fetching data from sybase using embedded SQL

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

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 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