If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL error 204 when we try to access tables via alias

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-05, 10:19
sordax sordax is offline
Registered User
 
Join Date: Feb 2005
Posts: 12
Question SQL error 204 when we try to access tables via alias

Hi. We have almost all our tables defined on library lib1 and some on lib2. We have alias defined on lib1 to access tables on lib2 so there is no need to qualify library name. Alias for tables on lib2 are defined this way:

CREATE ALIAS lib1.table1 FOR lib2.table1;

Both table owner and alias owner is the same. Tables reside on a AS/400 server and we are accesing database from a DB2 client on a PC workstation (DB2 is version 7)

When we try to access one of these tables (for example select * from table1) we get error

SQL0204N "NAME .TABLE1" is an undefined name. SQLSTATE=42704

Where NAME happens to be the table/alias owner.

We have no problem if we qualify the library name where alias is defined (select * from lib1.table1). There is no need to qualify library name for tables on lib1.

Any ideas?
Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 02-03-05, 10:38
blom0344 blom0344 is offline
Registered User
 
Join Date: Jan 2003
Location: Zutphen,Netherlands
Posts: 256
In my experience AS400 expects that the connection is set up through a library. If you do not specify another library as schema it will assume that you address the connection library.

May I ask how you set up connection to AS400 with the DB2 client (DB2/CLI)?

We use Client Access for this, would like to know how to connect through DB2 client....
__________________
Ties Blom
Senior Application Developer BI
Getronics Healthcare
DB2,ORACLE,Powercenter,BusObj,Access,
SQL, SQL server
Reply With Quote
  #3 (permalink)  
Old 02-04-05, 03:41
sordax sordax is offline
Registered User
 
Join Date: Feb 2005
Posts: 12
Well, if you are asking for the connect statement we use to establish our conenction through DB2 it is:

connecto to DATABASE user LIB1 using PASSWORD

So user name is the same as the library name where alias are defined.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On