DB2 SQL error

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pegasus
Participant
Posts: 8
Joined: Wed Jun 23, 2004 3:48 am

DB2 SQL error

Post by pegasus »

I have a DB2 plugin stage that select from a table which join to a view. Theres no error when validate. But it get aborted after extracting 1500 records.

Here's the error:

JobGetClientNum01..Transformer_16: SQLExtendedFetch: Error retrieving results from server.

JobGetClientNum01..Transformer_16: [IBM][CLI Driver][AS] SQL0501N The cursor specified in a FETCH or CLOSE statement is not open. SQLSTATE=24501

Anyone know how to solve this?
Eric
Participant
Posts: 254
Joined: Mon Sep 29, 2003 4:35 am

Post by Eric »

Code: Select all

SQL0501N The cursor specified in a FETCH or CLOSE statement is not open.  

Explanation: The program attempted to either: (1) FETCH using a cursor, or (2) CLOSE a cursor at a time when the specified cursor was not open. 

The statement cannot be processed. 

User Response: Check for a previous message (SQLCODE) that may have closed the cursor. Note that after the cursor is closed, any fetches or close cursor statements receive SQLCODE -501. 

If no previous SQLCODEs have been issued, correct the application program to ensure that the cursor is open when the FETCH or CLOSE statement is executed. 
I'm note sure if this helps, but it looks like the connection to the Database is being lost ... ?
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
Did you upgrade your DB2 recently?
Did you face any catalog problems? Is the catalog working fine?
O ryou simply upgrade your catalog and try job again.

ketfos
Neil C
Participant
Posts: 46
Joined: Sun Apr 06, 2003 8:59 pm
Location: Auckland, New Zealand

Post by Neil C »

What was the error code from the DB2 system log (allways assuming there was one)?
pegasus
Participant
Posts: 8
Joined: Wed Jun 23, 2004 3:48 am

Finally Solve!!!

Post by pegasus »

Tq all for replying but I had finally found the solution. :D

Now I enter onli 1 table name into the "Table names:" field of the DB2 plug-in stage, it can run successfully.So whenever I need to join 2 or more table I would need to use user defined SQL as the generated SQL cant have more than 1 table. So this counld be a bug in the DB2 plugin stage as I see it.
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Re: Finally Solve!!!

Post by ogmios »

Or maybe the functionality is not really what you expect... I doubt Ascential would see this as a bug.

"Working with DataStage is most of the time working to get around DataStage quirks" :wink:

Ogmios
Post Reply