+ Reply to Thread
Results 1 to 3 of 3

Thread: SQL Command to check table existence

  1. #1
    Guest.Visitor Guest

    Default SQL Command to check table existence

    Is there a direct SQL command to check the existence of a table without using CL program. Like in MS SQL, they have SYSOBJECTS to check existence of a table. Thank you very much for any help I could get.

  2. #2
    Guest.Visitor Guest

    Default SQL Command to check table existence

    Emer, You could read the system catalog to check to see whether a table exists. The table you need to use to check for a file's existance is systables. Something like select count(*) from systables where table_name = 'MYTABLE' should work. There are other system catalog files containing fields, views, indexes, procedures, etc. David Morris

  3. #3
    Guest.Visitor Guest

    Default SQL Command to check table existence

    select count(*) from systables where table_name = '' This will give you a numeric response of 0 or greater than 0 if the table exists. Remember that systables are in lib qsys2. Hope this helps!

+ Reply to Thread

Similar Threads

  1. Check an entry from Host Table
    By G.Gaunt in forum RPG
    Replies: 2
    Last Post: 06-16-2003, 11:07 PM
  2. Check existence of user-id from RPG
    By Guest.Visitor in forum Programming
    Replies: 4
    Last Post: 07-05-2001, 05:26 AM
  3. Check existence of IFS streamfile
    By Guest.Visitor in forum Programming
    Replies: 10
    Last Post: 11-16-2000, 11:48 AM
  4. Check library existence on other AS/400
    By Guest.Visitor in forum Programming
    Replies: 5
    Last Post: 05-10-1999, 12:11 PM
  5. Check Active Job Command
    By Guest.Visitor in forum Programming
    Replies: 7
    Last Post: 03-26-1998, 10:16 AM

Posting Permissions

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