Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / January 2005

Tip: Looking for answers? Try searching our database.

SQL0204N

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Najm Hashmi - 17 Jan 2005 13:47 GMT
Hi All,
I am try to create a store procedure in DB2 version 8.1 Personal Edition. I
new also new to DB2. I am getting the following error:
[IBM][CLI Driver][DB2/NT] SQL0204N  "MYDB.MYOPTIONS" is an undefined name.
LINE NUMBER=8.  SQLSTATE=42704

Environment:
Windows 2000 Professional SP4
DB2 8.1 PE

I am using development center to run this code:
CREATE PROCEDURE PROC1
(
)
SPECIFIC  BTCHQOPTS
DYNAMIC RESULT SETS 1
LANGUAGE     SQL
P1:BEGIN
DECLARE   SQLCODE                    INTEGER   DEFAULT  0;
DECLARE   S_SQLCODE                  INTEGER   DEFAULT  0;
DECLARE   S_Temp_Cursor0    CURSOR    WITH HOLD     WITH RETURN TO CLIENT
FOR   SELECT
    SUSPEND,
    STOPADMTSKTERMUSER,
    SUSPENDUSERONTERM

 FROM  MYOPTIONS JOIN MYORGANIZATION ON MYOPTIONS.ORGANIZATIONID  =
MYORGANIZATION.ORGUNIQUEID
 WHERE  MYORGANIZATION.ORGNAME  = (USER) ;
DECLARE   CONTINUE HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
SET   S_SQLCODE=  SQLCODE;
 OPEN   S_Temp_Cursor0 ;
END P1

Thanks in advance for  your help.
Regards,
Najm
Knut Stolze - 17 Jan 2005 15:31 GMT
> Hi All,
> I am try to create a store procedure in DB2 version 8.1 Personal Edition.
> I new also new to DB2. I am getting the following error:
>  [IBM][CLI Driver][DB2/NT] SQL0204N  "MYDB.MYOPTIONS" is an undefined
>  [name.
> LINE NUMBER=8.  SQLSTATE=42704

$ db2 "? sql0204"

SQL0204N "<name>" is an undefined name.

> Environment:
> Windows 2000 Professional SP4
[quoted text clipped - 18 lines]
>   FROM  MYOPTIONS JOIN MYORGANIZATION ON MYOPTIONS.ORGANIZATIONID  =
> MYORGANIZATION.ORGUNIQUEID

Here you are referring to a table (or view) named "MYOPTIONS".  This table
is not found.  You should either set the CURRENT SCHEMA special register to
the schema in which the table was defined, or specify the fully qualified
table name, i.e. myschema.myoptions.

I would always prefer the 2nd approach because it makes things much clearer.
(I never accepted saving a few keystrokes as a valid reason to have to
start guessing at the meaning of some piece of code.)

>   WHERE  MYORGANIZATION.ORGNAME  = (USER) ;
>  DECLARE   CONTINUE HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
>  SET   S_SQLCODE=  SQLCODE;
>   OPEN   S_Temp_Cursor0 ;
> END P1

Signature

Knut Stolze
Information Integration
IBM Germany / University of Jena

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.