Subject Re: [firebird-support] Re: Error -104 on SELECT
Author Tim Seyfarth
Hello Svein,
This is the SQL code that we used to create the table.
CREATE TABLE "contacts" (
"Contact_Name" CHAR(30) NOT NULL,
"ContactDesc" CHAR(50) NOT NULL,
"Contact_Phone" CHAR(20) NOT NULL,
"ContactFax" CHAR(20) NOT NULL,
"Contact_Fax_2" CHAR(20) NOT NULL,
"Contact_Fax_3" CHAR(20) NOT NULL,
"EmailAddress" CHAR(50) NOT NULL,
"EmailAddress1" CHAR(50) NOT NULL,
"EmailAddress2" CHAR(50) NOT NULL,
"Frequency" INTEGER NOT NULL
)

Will try what you suggest but being very green, not sure really about
the double quotes.
Tim


On 1/31/2011 10:34 AM, Svein Erling Tysvær wrote:
>
> >Yes, axcys is a schema. I removed the word to now use this command
> >DatabaseQuery(1, "SELECT * FROM contacts;") and the error -104 was
> >replaced with error -204 Table unknown. I checked the DB with
> >FlameRobin, there is in fact a table called "contacts". Clicking DDL in
> >FlameRobin yields the following (wanted to show the table and its
> >columns to you and not sure another way to do so). Why does TB
> >think there is no contacts Table?
> >
> >CREATE TABLE "contacts"
> >(
> > "Contact_Name" Char(30) NOT NULL,
> > "ContactDesc" Char(50) NOT NULL,
> > "Contact_Phone" Char(20) NOT NULL,
> > "ContactFax" Char(20) NOT NULL,
> > "Contact_Fax_2" Char(20) NOT NULL,
> > "Contact_Fax_3" Char(20) NOT NULL,
> > "EmailAddress" Char(50) NOT NULL,
> > "EmailAddress1" Char(50) NOT NULL,
> > "EmailAddress2" Char(50) NOT NULL,
> > "Frequency" Integer NOT NULL
> >);
>
> If you use double quotes when creating a table, then the table and
> field names become case sensitive and you have to use double quotes
> whenever you refer to them. So try something like
>
> DatabaseQuery(1, "SELECT * FROM ""contacts""")
>
> or whatever you need to do to put double quotes within your strings.
>
> The alternative is to create the table without double quotes, then
> your original query ought to have worked.
>
> HTH,
> Set
>
>


[Non-text portions of this message have been removed]