Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-09
9
Medium Priority
?
1,775 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 46

Assisted Solution

by:Kent Olsen
Kent Olsen earned 100 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 400 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

876 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