RE: Silly question time -- with answer (long)
Posted in 1998
I'm glad I qualified my previous response with "I haven't tested it...".
Today, I went and tested it, and much to my surprise, running a query
against the system catalog of a MODE ANSI database with an unquoted owner
name of informix does work; OnLine actively case-converts the owner to
lower case when the owner is user 'informix'.
SELECT * FROM informix.systables;
SELECT * FROM Informix.systables;
On the other hand, this does not work for other users.
So, to contradict myself, user informix does get special treatment.
Indeed, if a DBA creates a table owned by user informix, it still gets
handled specially:
CREATE TABLE 'informix'.sometable
(
col01 SERIAL NOT NULL PRIMARY KEY,
col02 CHAR(20) NOT NULL
);
SELECT * FROM informix.sometable;
I suppose this will be misinterpreted as "it is a good idea to create
tables in a MODE ANSI database with owner 'informix'". I disagree with
this, but you will probably get away with it if you decide to take the lazy
way out. I think you should never create tables owned by user informix and
you should accept the discipline of getting the owner name quoted
properly.
And, since there were some questions about who uses MODE ANSI databases,
the last system I assembled used a MODE ANSI database for its main
activities, though it also accesses a non-logged database (created before I
got any say in the matter) using two separate connections, of course. The
main database needed to have transactions in place; the automatic isolation
level and the automatic transactions were advantages for the application-a
small web based data entry/report system.
Yours in learning mode,
Jonathan Leffler (jleffler@visa.com) #include <bother.ms-exchange.h>
>----------
From: Jonathan Leffler[SMTP:jleffler@earthlink.net]
>Sent: Friday, April 24, 1998 9:42 PM
>ANTS wrote:
>> I wonder in mode ANSI databases, when you write owner.tablename
>> owner will be capitalized (because of ANSI) and you get table
>> not found error msg. BUT if you write informix.tablename, informix
>> won't be capitalized and you get the correct results??
>> Any ideas?? Does informix get special treatments?
>No, I don't think the user informix gets special treatment. I admit
>that I have not checked today that you have to write
>"informix".SysTables to refer to the primary table in the catalogue,
>but I'm pretty sure you have to do so.