• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1863
  • Last Modified:

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

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
okonita1
Asked:
okonita1
  • 4
  • 4
2 Solutions
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi okonita,

Several things could cause this.

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

0
 
BigSchmuhCommented:
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
 
okonita1Author Commented:
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
BigSchmuhCommented:
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
 
okonita1Author Commented:
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
 
BigSchmuhCommented:
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
 
okonita1Author Commented:
Just tried the recommendations from this thread and my problem did not go away...any more ideas?

Thanks
0
 
BigSchmuhCommented:
(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
 
okonita1Author Commented:
Thanks to you guys
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now