Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

DB2

 
   Database Help (Home) -> General Discussion RSS
Next:  Null field in junction table  
Author Message
yoav

External


Since: Aug 24, 2008
Posts: 2



(Msg. 1) Posted: Sun Aug 24, 2008 8:25 am
Post subject: DB2
Archived from groups: comp>databases (more info?)

I have been writing a program to manage a database of SQL interfaced to DB2.
The problem is,that when I run the program I get a massege,error:
DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=Name.NUMBERS, DRIVER=3.
50.152

where "Name" is my userid Name (The real name is classified).
I have already seen your answer to someone else about that error:

his question:
This is my first time starting a topic here so I hope this is the right
place. I am having problems running SQL queries on a Version 8 DB2
database for Windows Server using the type 4 driver. I get a connection
but when I run a query, I get this error:

DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704

For example if my query was "SELECT * from TABLE" , I would get the
error:

"DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704 DB2ADMIN.TABLE" [SELECT
* FROM IDSC.TABLE]

I looked at the error codes online and they do not provide me with any
information I did not already know. Any help would be greatly
appreciated.

Kindest Regards,

Tony

your answer:
If the userid you are using is db2admin, and you don't supply a high level
qualifier on the table name, the DB2 assumes that DB2ADMIN is the qualifier
(schema) name. You can use the SET SCHEMA statement before hand, use an
alias, or use the a userid with the same name as your schema.

My question is about terminology:
1)What is a high level qualifier?
2)When using SET SCHEMA,what are parameters and what do they mean?
3)What is alias?
4)When I use userid with same name as my schema,how do I know the name of my
schema?

Thanks in advanced,
Yoav

 >> Stay informed about: DB2 
Back to top
Login to vote
Lennart

External


Since: Jan 11, 2008
Posts: 130



(Msg. 2) Posted: Sun Aug 24, 2008 8:25 am
Post subject: Re: DB2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 24, 10:25 am, "yoav" wrote:
> I have been writing a program to manage a database of SQL interfaced to DB2.
> The problem is,that when I run the program I get a massege,error:
> DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=Name.NUMBERS, DRIVER=3.
> 50.152  
>
> where "Name" is my userid Name (The real name is classified).
> I have already seen your answer to someone else about that error:
>
> his question:
> This is my first time starting a topic here so I hope this is the right
> place.  I am having problems running SQL queries on a Version 8 DB2
> database for Windows Server using the type 4 driver. I get a connection
> but when I run a query, I get this error:
>
> DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704
>
> For example if my query was "SELECT * from TABLE" , I would get the
> error:
>
> "DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704 DB2ADMIN.TABLE" [SELECT
> * FROM IDSC.TABLE]
>
> I looked at the error codes online and they do not provide me with any
> information I did not already know.  Any help would be greatly
> appreciated.  
>
> Kindest Regards,
>
> Tony
>
> your answer:
> If the userid you are using is db2admin, and you don't supply a high level
> qualifier on the table name, the DB2 assumes that DB2ADMIN is the qualifier
> (schema) name. You can use the SET SCHEMA statement before hand, use an
> alias, or use the a userid with the same name as your schema.
>

You will probably get more answers in:

comp.databases.ibm-db2

> My question is about terminology:
> 1)What is a high level qualifier?

Given the description above it is the schema that your table resides
in. Every DBMS I know (except mysql) have a concept schema. You can
find out what schema your table belong to by:

select tabschema from syscat.tables where tabname = '<your table>'

> 2)When using SET SCHEMA,what are parameters and what do they mean?

If you don't qualify your table with a schema DB2 assume the schema to
be the name of the user asking the query. Say your query looks like:

select * from users

and that you are logged in as db2admin. DB2 thinks this query is:

select * from db2admin.users

You can prevent this by either specifying the schema as (assuming yoav
as schema):

select * from yoav.users

or by setting the default schema as in:

set schema = yoav

Personally I think it is a good idea to always specify the schema in
the query.


/Lennart

[...]

 >> Stay informed about: DB2 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Erwin modeling basic question - Hi, Can anyone tell me when doing db design in ERWin, how do you make the table column area longer so more attributes can be shown in the diagram? I thought it'd be as simple as dragging the lower corner of the table, but it didn't work. And I didn't....

number of attributes - Is there a maximum to how many attributes a table should have? I'm implementing a user-based web-application for school. Should I, for example, put all the user characteristics and preferences in one table or should I split it in multiple tables.

History function - G'day, First of all, I'm using PostgreSQL 8.0.1 on a Debian Linux machine. I've got to set up a database which as well features some sort of history function. For example, if there's a table tbl_persons like: id | name | surname | ... there should b...

looking for a tool/ middleware tool which... - Hi all. I'm looking for a tool which should act like some kind of middleware/ logical layer bewtween the SQL server and the webbased user interface. - It should be possible to easily create simple web forms (only data input and output) without..

Designing large databases - Hi, I don't know how to formulate this question, so I try this and see where it ends. I want to create a database that will probably grow very big. How should I do? My database is a Mysql DB and it will store free text where you can search in it. //M
   Database Help (Home) -> General Discussion All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]