Subject | RE: [ib-support] uppercase and double quotes |
---|---|
Author | Helen Borrie |
Post date | 2001-04-11T10:16:51Z |
At 11:43 AM 11-04-01 +0200, you wrote:
You are looking at a difference between the database rules and the rules imposed by the client program.
The database rule is this:
If you create the object names without the double quotes, then they can be accessed "as created" or uppercase.
If you create them *with* the double quotes, the engine forces you to use them "as created" only.
The double-quotes are optional, except that you must use them for any objects that use a reserved word as an object name. In previous versions of IB, there was no way to create an object with the same name as a reserved word, e.g.
create table Type( /* previously caused an error */
create table "Type"( /* now OK but you must use double quotes AND exact case to refer to it. */
create table "Empleado" ( /* forces exact case, but double quotes are not needed when referring to it */
Some client tools force double-quotes, i.e. they prevent you from taking the case-insensitive option. For example, IBConsole enforces it always; but some of the others allow you to make it optional for object names that are not reserved words (I don't know whether IBExpert does this or not).
As this rule is new in IB 6, some tools would be unusable with versions lower than 6, as the double-quotes are not recognised.
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Nando,Jordi,
>
> > to me, it is exactly as designed/implemented/advertised.
> > What is it exactly that you find wrong in the results?
>
>I think I'm a bit confused, the statement created by IBExpert is:
>
> CREATE TABLE "empleado" (
> "dni" INTEGER NOT NULL,
> "nombre" VARCHAR(50));
>
>then I get error when:
>
> select * from empleado
>
>and works when:
>
> select * from "empleado"
>
>
>according to this, it seems that the quotes are part of the name, I mean
>they are valid characters for the name of the table. If so, there should be
>a difference between "empleado" with quotes and empleado without them. But
>then, why at IBExpert when I enter the name empleado (whitout quotes) in the
>table name field, then IBExpert generates a create table statement as
>
> create table "empleado"
>
>with quotes in the table name?
>
>The question is, is the same a table name with quotes and without it? if
>it's not, then I don't understand the IBExpert behaviour, but if it is, then
>I don't understand why it gets me the error when I declare the table with
>quotes and do the select without them.
>
>Maybe I'm confused at some point? what is the real meaning of quotes at
>table name?
You are looking at a difference between the database rules and the rules imposed by the client program.
The database rule is this:
If you create the object names without the double quotes, then they can be accessed "as created" or uppercase.
If you create them *with* the double quotes, the engine forces you to use them "as created" only.
The double-quotes are optional, except that you must use them for any objects that use a reserved word as an object name. In previous versions of IB, there was no way to create an object with the same name as a reserved word, e.g.
create table Type( /* previously caused an error */
create table "Type"( /* now OK but you must use double quotes AND exact case to refer to it. */
create table "Empleado" ( /* forces exact case, but double quotes are not needed when referring to it */
Some client tools force double-quotes, i.e. they prevent you from taking the case-insensitive option. For example, IBConsole enforces it always; but some of the others allow you to make it optional for object names that are not reserved words (I don't know whether IBExpert does this or not).
As this rule is new in IB 6, some tools would be unusable with versions lower than 6, as the double-quotes are not recognised.
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________