delphisybaseadvantage-database-server

Detect if a table exists


In SQL Server you can write SQL to check if a table exists. How can I do that for ADS?

I have a need to write some Delphi code to say if table exists do this else this...


Solution

  • The system procedure sp_GetTables can tell you what tables exist in the directory that you connected to:

    EXECUTE PROCEDURE sp_GetTables( NULL, NULL, NULL, 'TABLE' )

    A non-SQL solution would be to use the AdsCheckExistence API.