How can I get sqsh to tell me which tables are available?
A:
I am not familiar with systables. What flavor of Sybase are you running? ASA perhaps?
Please find appended a sqsh function (which you can put in your .sqshrc) which demonstrates some querying of the ASE (Adaptive Server Enterprise) catalog tables and the use of the Ed Barlow system stored procedure library http://www.edbarlow.com/gem/procs_only/index.htm to figure out what objects are in a database.
# Shorthand for sp__helptext or sp__revtable \func -x ? IF EXISTS (SELECT * FROM sysobjects WHERE name = \\'${1}\\') BEGIN DECLARE @type VARCHAR(3) SELECT @type = type FROM sysobjects WHERE name = \\'${1}\\' IF @type IN (\\'U\\') exec sp__revtable ${1} ELSE exec sp__helptext ${1} END ELSE -- default to sp__ls (which can list partial matches) if an exact match wasn't found in sysobjects exec sp__ls ${1} go \done
Paul Harrington
2009-05-29 02:45:37
A:
Does sp_tables
work for you? Are you trying to get tab completion when creating a query?
brianegge
2009-06-04 01:35:16