Solved

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

Posted on 2010-09-09
9
1,645 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:Kdo
Kdo 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now