Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007

    Unanswered: AS/400 Query File With Period(.) In Name

    I have a question and finding an answer for it seems to be quite difficult. Maybe I'm not looking in the right place. So I thought I better ask here as you guys have been quite helpful in the past.

    I am writing a Java app that runs an SQL query on a DB2 table in our AS/400. This query works excellent so I know my formatting is not wrong and my connection exists. But it only works on a copy of the original table. The reason for this is that the original table's name has a period in it. (ex. Y2K.NAME). I can't change it's name as it's used in a few hundred RPG programs on the 400.

    I'm just wondering if anyone knows how to query a table with a period in the name via SQL. I've tried replacing the period with several different characters, putting the name in quotes ("Y2K.NAME"), etc. But each time my program fails to find the file. I'm thinking the answer is simple, I just don't know it. So if anyone knows how to access a file with a period in the name with SQL (via Java), your help would be greatly appreciated.

    Thanks in advance.


  2. #2
    Join Date
    Jan 2008
    Get ride of "Y2K." and just use "NAME" Typcally on the 400 "Y2k" is a file with a table named "NAME". Otherwise, if the table is infact named "Y2K.NAME" I am not sure what to tell you.


  3. #3
    Join Date
    Jan 2003
    Provided Answers: 5
    How about creating a view like this:

    create view y2k_name as select * from

    Then use the view instead of the table.


  4. #4
    Join Date
    Jan 2007
    Hello, thanks for your responses; I appreciate them. Sorry I didn't get back sooner. I found the solution by accident. I was putting double quotes around both the file name and the schema. When I had a basic select run via RAD, it would give me

    select * from "qs36f"."" <--Which would work for RAD, but not me!

    So I removed the quotes from qs36f and forgot to remove them from I ran the simple select again:

    select * from qs36f.""

    Results!! Why it was so picky, I don't know. But it's working now so Woo Hoo!!

    Thanks again!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts