Solved

Why SQL3304N  The table does not exist soon after a Declare Cursor was executed & successful?

Posted on 2010-09-09
9
1,681 Views
Last Modified: 2012-05-10
Hello all,
Something baffles me here. The code that you see was executed successfully and rows were loaded. Notlong after I decided to test again but now I am getting the following error:
db2 => DECLARE LOAD_CUR1 CURSOR DATABASE DB2DB USER myusrid USING mypasswd FOR SELECT * FROM ECDP012.RCATB_SMS_CDM;
DB20000I  The SQL command completed successfully.

db2 => LOAD FROM LOAD_CUR1 OF CURSOR warningcount 20 REPLACE INTO ECDBT012.RCATB_SMS_CDM;
SQL3304N  The table does not exist.

What exactly is happening here? Anyone seen this type of event before and how can I resolve the matter?

Thanks
0
Comment
Question by:okonita1
  • 4
  • 4
9 Comments
 
LVL 45

Assisted Solution

by:Kent Olsen
Kent Olsen earned 25 total points
ID: 33642183
Hi okonita,

Several things could cause this.

-- Is the client connected to a database?
-- Is it connected to the correct database?

0
 
LVL 18

Accepted Solution

by:
BigSchmuh earned 100 total points
ID: 33680342
Is your CLP command session AutoCommit mode ?
If so, your open cursor is committed (and closed) instantly...and does not exist for the LOAD command
0
 

Author Comment

by:okonita1
ID: 33723179
BigSchmuh,
How do I find out if CLP command session is set to AutoCommit mode ? I have no idea where that is turned on or off.

kdo,
The answer is yes to your questions
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 18

Expert Comment

by:BigSchmuh
ID: 33723220
In the "Command reference" guide, you should find the "Command Line Processor (CLP) options".
The "-c" option is ON by default and means your statements are send with AUTOCOMMIT

So, you have to open your CLP sessions using this example syntax:
   db2 +c -f YourStatementsFile.SQL
0
 

Author Comment

by:okonita1
ID: 33723257
Thank you BigSchmuh. I googled CLP options and found same thing as you just described. I will try it when I get in the office today...

How can I make it permanent?
0
 
LVL 18

Expert Comment

by:BigSchmuh
ID: 33723264
You can set it permanently using DB2OPTIONS environment variable.
This variable is ALREADY defined in your platform with some default values that should be kept...
0
 

Author Comment

by:okonita1
ID: 33726737
Just tried the recommendations from this thread and my problem did not go away...any more ideas?

Thanks
0
 
LVL 18

Expert Comment

by:BigSchmuh
ID: 33726836
(Sorry to ask but) are you sure your ECDBT012.RCATB_SMS_CDM table exists ?

You can check using:
SELECT Count(*) FROM ECDP012.RCATB_SMS_CDM;
SELECT Count(*) FROM ECDBT012.RCATB_SMS_CDM;
0
 

Author Closing Comment

by:okonita1
ID: 33740206
Thanks to you guys
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

830 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