Discussion (10)0
Log in or sign up to continue

If you are on an older system where INFORMATION_SCHEMA is not available, you can use the %Library.SQLCatalog class queries.  Here is an example:

 

#include %occStatus
    new stmt,sc,rset,handle
    set stmt=##class(%SQL.Statement).%New()
    set sc=stmt.%PrepareClassQuery("%Library.SQLCatalog","SQLTables")
    if $$$ISERR(sc) { write $System.Status.DisplayError(sc) QUIT }
    set rset=stmt.%Execute()
    do rset.%Display()
    QUIT