473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Undefined name

Hi

I'm trying to set up an application that uses a DB2 database.
I know nothing at all about DB2 (or Java) and have simply followed a set of
bad instructions to try and run this application.

This is the error I get:

SQL=[select sharepar.choiceparam.item, sharepar.choiceparam.description from
sharepar, sharepar.choiceparam WHERE sharepar.choiceparam.lang = ? AND
sharepar.choiceparam.choicename = ? AND sharepar.choiceparam.status = ?
ORDER BY sharepar.choiceparam.description ASC]: Unable to run query:
[IBM][CLI Driver][DB2/NT] SQL0204N "DB2ADMIN.SHAREPAR" is an undefined name.
SQLSTATE=42704

I don't know where it gets "DB2ADMIN.SHAREPAR" from as it is not in the
query. I assume it is attaching the username which was the same username
used to create the tables and therefore (as I understand) should have all
the necessary rights over those tables.

How do I get it to either stop referring to the DB2ADMIN part or to
recognise it as a valid name?

Details:
The user set-up to access the database is DB2ADMIN.
It is a DB2 Universal Database Personal Edition Ver 7
The application accessing it a Java class JDK 1.2.2 (I do not have access to
the source)
The application server is Enhydra 3.0.1
I also had to install something called 'Database Links' - I have no idea
what this is or what it's purpose is
I'm using Win XP Prof

Thanks in advance, Stephen
Nov 12 '05 #1
7 23032
"Laygo" <go****@com-du-it.com> wrote in message
news:76*************************@posting.google.co m...
Hi

I'm trying to set up an application that uses a DB2 database.
I know nothing at all about DB2 (or Java) and have simply followed a set of bad instructions to try and run this application.

This is the error I get:

SQL=[select sharepar.choiceparam.item, sharepar.choiceparam.description from sharepar, sharepar.choiceparam WHERE sharepar.choiceparam.lang = ? AND
sharepar.choiceparam.choicename = ? AND sharepar.choiceparam.status = ?
ORDER BY sharepar.choiceparam.description ASC]: Unable to run query:
[IBM][CLI Driver][DB2/NT] SQL0204N "DB2ADMIN.SHAREPAR" is an undefined name. SQLSTATE=42704

I don't know where it gets "DB2ADMIN.SHAREPAR" from as it is not in the
query. I assume it is attaching the username which was the same username
used to create the tables and therefore (as I understand) should have all
the necessary rights over those tables.

How do I get it to either stop referring to the DB2ADMIN part or to
recognise it as a valid name?

Details:
The user set-up to access the database is DB2ADMIN.
It is a DB2 Universal Database Personal Edition Ver 7
The application accessing it a Java class JDK 1.2.2 (I do not have access to the source)
The application server is Enhydra 3.0.1
I also had to install something called 'Database Links' - I have no idea
what this is or what it's purpose is
I'm using Win XP Prof

Thanks in advance, Stephen


DB2ADMIN is the user id you are using for dynamic SQL or the schema name
used during the bind of static SQL. I am not sure which is being used in
your application (dynamic or static SQL).

All tables have a tablename and schema name to uniquely identify them. Using
the Control Center and looking a the list of tables, is there a table name
SHAREPAR, and if so, what is the schema name(s) ?
Nov 12 '05 #2
"Mark A" <ma@switchboard.net> wrote in message
news:rJ*****************@news.uswest.net...

DB2ADMIN is the user id you are using for dynamic SQL or the schema name
used during the bind of static SQL. I am not sure which is being used in
your application (dynamic or static SQL).

All tables have a tablename and schema name to uniquely identify them. Using the Control Center and looking a the list of tables, is there a table name
SHAREPAR, and if so, what is the schema name(s) ?

If you don't know how to start the Control Center submit the following query
from a command prompt. This will list all the table names and views on your
system.

db2 "select tabschema, tabname from syscat.tables"
Nov 12 '05 #3
Stephen,
Can you issue a SELECT CURRENT SCHEMA FROM SYSIBM.SYSDUMMY1
right before that query.
Your current user may be DB2ADMIN, but maybe previous code switched the
schema.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4
"Mark A" <ma@switchboard.net> wrote in message news:<rJ*****************@news.uswest.net>...
DB2ADMIN is the user id you are using for dynamic SQL or the schema name
used during the bind of static SQL. I am not sure which is being used in
your application (dynamic or static SQL).

All tables have a tablename and schema name to uniquely identify them. Using
the Control Center and looking a the list of tables, is there a table name
SHAREPAR, and if so, what is the schema name(s) ?


The table is "choiceparam", "sharepar" is the schema name.

I have no idea whether it's static or dynamic SQL.

Executing "SELECT CURRENT SCHEMA FROM SYSIBM.SYSDUMMY1" returned
"DB2ADMIN"

While I could see the tables when looking at the Control Center, they
didn't apprear to show up when executing "select tabschema, tabname
from syscat.tables".

The code is in what I understand to be a precomplied Java class and I
have no access to the source (unless someone can tell me how to
view/change the code in a class file? Looks like greek in a text
editor).

This is the SQL used to create that particular table (while connected
to the database as db2admin):

create table sharepar.choiceparam ( \
lang VARCHAR(10) DEFAULT ' ' NOT NULL , \
choicename VARCHAR(10) DEFAULT ' ' NOT NULL , \
item VARCHAR(10) DEFAULT ' ' NOT NULL , \
description VARCHAR(80) DEFAULT ' ' NOT NULL , \
status VARCHAR(10) DEFAULT ' ' , \
oid DECIMAL(19,0) NOT NULL PRIMARY KEY, \
version INTEGER NOT NULL )

-- Choiceparm indexes

CREATE INDEX I1_sharepar.choiceparam ON sharepar.choiceparam ( lang )
CREATE INDEX I2_sharepar.choiceparam ON sharepar.choiceparam (
choicename )
CREATE INDEX I3_sharepar.choiceparam ON sharepar.choiceparam ( item )
Nov 12 '05 #5
"Laygo" <go****@com-du-it.com> wrote in message
news:76**************************@posting.google.c om...
The table is "choiceparam", "sharepar" is the schema name.

I have no idea whether it's static or dynamic SQL.

Executing "SELECT CURRENT SCHEMA FROM SYSIBM.SYSDUMMY1" returned
"DB2ADMIN"

While I could see the tables when looking at the Control Center, they
didn't apprear to show up when executing "select tabschema, tabname
from syscat.tables".

The code is in what I understand to be a precomplied Java class and I
have no access to the source (unless someone can tell me how to
view/change the code in a class file? Looks like greek in a text
editor).

This is the SQL used to create that particular table (while connected
to the database as db2admin):

create table sharepar.choiceparam ( \
lang VARCHAR(10) DEFAULT ' ' NOT NULL , \
choicename VARCHAR(10) DEFAULT ' ' NOT NULL , \
item VARCHAR(10) DEFAULT ' ' NOT NULL , \
description VARCHAR(80) DEFAULT ' ' NOT NULL , \
status VARCHAR(10) DEFAULT ' ' , \
oid DECIMAL(19,0) NOT NULL PRIMARY KEY, \
version INTEGER NOT NULL )

-- Choiceparm indexes

CREATE INDEX I1_sharepar.choiceparam ON sharepar.choiceparam ( lang )
CREATE INDEX I2_sharepar.choiceparam ON sharepar.choiceparam (
choicename )
CREATE INDEX I3_sharepar.choiceparam ON sharepar.choiceparam ( item )


Here is the SQL statement (after running through a formatter):

SELECT
sharepar.choiceparam.item,
sharepar.choiceparam.description
FROM sharepar,
sharepar.choiceparam
WHERE sharepar.choiceparam.lang = ?
AND sharepar.choiceparam.choicename = ?
AND sharepar.choiceparam.status = ?
ORDER BY sharepar.choiceparam.description ASC

This SQL statement has two tables in the FROM clause and the first one
(without a explicit schema name) is causing the problem. The table name is
sharepar and since the schema is not specified, DB2 used your userid
(DB2ADMIN). I think this is a mistake of some kind, and the table "sharepar"
should not exist in the above SQL statement.

You can have two tables in a SELECT, but the 2 tables would normally be
joined with a join predicates (which don't exist here). I would contact the
person who wrote the code, because it looks defective. I think the code FROM
clause should say:

FROM sharepar.choiceparam

Sorry I didn't notice this earlier.
Nov 12 '05 #6
No problem.

The developers long disappeared in a time when many people leave this
country for 'greener pastures'.

If I create a table called sharepar which does nothing... would this
allow that SQL statement to execute? I wonder... and will test it. If
it won't work I would appreciate any suggestions as to how else to
trick it.

Thanks for the assistance, Stephen

"Mark A" <ma@switchboard.net> wrote in message news:<eP****************@news.uswest.net>...
This SQL statement has two tables in the FROM clause and the first one
(without a explicit schema name) is causing the problem. The table name is
sharepar and since the schema is not specified, DB2 used your userid
(DB2ADMIN). I think this is a mistake of some kind, and the table "sharepar"
should not exist in the above SQL statement.

You can have two tables in a SELECT, but the 2 tables would normally be
joined with a join predicates (which don't exist here). I would contact the
person who wrote the code, because it looks defective. I think the code FROM
clause should say:

FROM sharepar.choiceparam

Sorry I didn't notice this earlier.

Nov 12 '05 #7
Creating the table to trick it worked.

But from one problem to the next... the '?' in the sql statement... I
had understood this to be a wildcard. I'm assuming now that it is in
fact a paramater placeholder. I can't figure out where it gets the
information to pass to the sql as parameters so it looks like I'm
going to have to hack in to get the information I need and then dump
the whole thing. *Groan*

Have a good one... Stephen

"Mark A" <ma@switchboard.net> wrote in message news:<eP****************@news.uswest.net>...
This SQL statement has two tables in the FROM clause and the first one
(without a explicit schema name) is causing the problem. The table name is
sharepar and since the schema is not specified, DB2 used your userid
(DB2ADMIN). I think this is a mistake of some kind, and the table "sharepar"
should not exist in the above SQL statement.

You can have two tables in a SELECT, but the 2 tables would normally be
joined with a join predicates (which don't exist here). I would contact the
person who wrote the code, because it looks defective. I think the code FROM
clause should say:

FROM sharepar.choiceparam

Sorry I didn't notice this earlier.

Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: news.bigpond.com | last post by:
getting errors Notice: Undefined index: name in F:\uni\Software engineering\assignment4\guestbook.php on line 6 the variable $name is declared as $name = _POST; What could be causing this?...
11
by: Andrew Thompson | last post by:
I have written a few scripts to parse the URL arguments and either list them or allow access to the value of any parameter by name. <http://www.physci.org/test/003url/index.html>...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
49
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On...
4
by: John Oliver | last post by:
PHP Notice: Undefined index: name in /home/www/reformcagunlaws.com/new.php on line 6 PHP Notice: Undefined index: address in /home/www/reformcagunlaws.com/new.php on line 7 PHP Notice: ...
45
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
13
by: Oleg Konovalov | last post by:
Hi, I am working on a web application which among other things uses DHTML, Java and Javascript. It populates web page based on the contents of the database (resultset), and next to each row...
3
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice:...
3
by: mediator | last post by:
Hello I have a php contact email form on my a ecommerce shop website ! I am getting a Undefined index error messages coming from the top of the php code, the email form its self works fine, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.