SQL query of multi-member file on AS400
Create an SQL alias for the member and query the alias, see this page for an example.
On AS400 in interactive SQL in a 5250 session,
select * from myfile
returns rows from one member only when myfile has more than one member.
How can I get rows from a specific member?
Important: in the end I'd like to do this over JDBC with jt400 so really I want a solution that'll work there.
Why can't my As400 select from a newly created member alias?
This error message can indicate that the file/logical file/member does not exist.
SQL has no concept of Multiple Members, so you need to use an ALIAS.
create alias MyLib.MyAlias for MyLib.MyLogicalFile(MyMember); select * from MyLib.MyAlias; drop alias MyLib.MyAlias;