I'm getting this syntax error in IBM Informix using the dbaccess utility:
root@guava:/opt/informix# bin/dbaccess - -
Your evaluation license will expire on 2015-12-22 00:00:00
> show databases;
201: A syntax error has occurred.
Error in line 1
Near character position 1
Any suggestions?
Best Answer
You get the 'syntax error' because
SHOW DATABASES
is not a valid command in DB-Access. In fact,SHOW
is not a valid keyword in either DB-Access or the underlying DBMS.If anything was going to work, it would be
INFO DATABASES
; however, that is not actually supported in DB-Access (but it is in my SQLCMD program, which I use in preference to DB-Access, and have used since I first wrote it back in 1987).There are other
INFO
commands to list tables, columns, etc.These commands are interpreted by DB-Access and not by the Informix database server, and translate into queries against the system catalog of the current database. The list of databases is, therefore, somewhat different because the information is not a part of the system catalog of the current database.
The list of databases is available from a table in the
sysmaster
database:Example output from one Informix server:
Alternatively, if you run DB-Access in the curses-mode (either
dbaccess
ordbaccess dbname
), then there is a menu optionDatabases
which leads to a sub-menu that allows you to list, select, create, and drop databases.