1

I would like to capture all the "Alternative file names" (SQL table name), as opposed to the the short 10 character IBM i "SYSTEM" name for a specific IBM i library. I can see the value using the DSPFD command, but can't seem to capture it in an DSPFD to OUTFILE. Is there a command to do this, or an API?

 DSPFD FILE(MYSQL_LIB/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) OUTFILE(QTEMP/TEMP)

1 Answer 1

3

You can get all this information from SQL using qsys2.systables. Please see these links IBM link and RPG blog link

EDIT: I have never used this but there is also this QUSLMBR API. I have always done this using systables.

Here's an example:

SELECT table_name 
FROM qsys2.systables
WHERE system_table_name = 'MYTABLE'
  AND table_schema = 'MYLIB'

The table name and schema must be in upper case.

Sign up to request clarification or add additional context in comments.

1 Comment

for future reference, try to include the gist of the link, or in this case example code in your answer in case the link goes bad.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.