4

I have set up the code as described in this question.

Creating an alias works, as well as dropping it.

For members that I have created myself, this is working correctly, but for existing members I get the following error when selecting from the alias:

SQL State: 42704
Vendor Code: -204
Message: [SQL0204] MyMemberName in MyLib type *FILE not found.

Cause . . . . . : MyMemberName in TPLWHS type *FILE was not found. If the member name is *ALL, the table is not partitioned. If this is an ALTER TABLE statement and the type is *N, a constraint or partition was not found. If this is not an ALTER TABLE statement and the type is *N, a function, procedure, trigger or sequence object was not found. If a function was not found, MyMemberName is the service program that contains the function. The function will not be found unless the external name and usage name match exactly. Examine the job log for a message that gives more details on which function name is being searched for and the name that did not match.

Recovery . . . : Change the name and try the request again. If the object is a node group, ensure that the DB2 Multisystem product is installed on your system and create a nodegroup with the CRTNODGRP CL command. If an external function was not found, be sure that the case of the EXTERNAL NAME on the CREATE FUNCTION statement exactly matches the case of the name exported by the service program.

Any help you can offer is much appreciated. Thanks!

EDIT: Here is my code:

create alias MyLib.MyAlias for MyLib.MyLogicalFile(MyMember);

select * from MyLib.MyAlias;

drop alias MyLib.MyAlias;

The format of Lib.Alias has worked for me when I directly created the phyiscal and logical members. Perhaps the logical file is missing? I'll double check...

Community
  • 1
  • 1
IronicMuffin
  • 4,182
  • 12
  • 47
  • 90
  • Can you include an example of your CREATE ALIAS and SELECT commands? Are you qualifying the library on the CREATE ALIAS as in `CREATE ALIAS ALIASLIB/ALIASFILE FOR EXISTLIB/EXISTFILE (EXISTMBR)`? – James Allman Aug 25 '11 at 17:38
  • @JamesA I added some code. Hope it clears things up. – IronicMuffin Aug 25 '11 at 17:46
  • 1
    Are you sure MyLib.MyLogicalFile and member MyMember exists? `CREATE ALIAS` will complete successfully even if the library / table / member does not exist. – James Allman Aug 25 '11 at 19:34
  • @JamesA Aw crap, I think you're right. I got it work on some other Members. I'm not an As400 Developer, so I get confused on some of these messages. Thanks for your help. – IronicMuffin Aug 26 '11 at 15:39

1 Answers1

3

This error message can indicate that the file/logical file/member does not exist.

IronicMuffin
  • 4,182
  • 12
  • 47
  • 90