Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Small SQL problem
Wed, Feb 15 2006 12:24 PMPermanent Link

"Mike Saunders"
Just can't see how to fix this statement

SQL.Add('ALTER TABLE MEMORY "daily schedule" ' );

DBISAM does not like the multi word table name I thought I could
enclose with double quotes

Thanks

Mike
Wed, Feb 15 2006 2:28 PMPermanent Link

"Ralf Mimoun"
Mike Saunders wrote:
> Just can't see how to fix this statement
>
> SQL.Add('ALTER TABLE MEMORY "daily schedule" ' );

What DBISAM version? In 4.x, you have to write "MEMORY\daily schedule".

Ralf

Wed, Feb 15 2006 5:51 PMPermanent Link

"Mike Saunders"
Ralf Mimoun wrote:

> Mike Saunders wrote:
> > Just can't see how to fix this statement
> >
> > SQL.Add('ALTER TABLE MEMORY "daily schedule" ' );
>
> What DBISAM version? In 4.x, you have to write "MEMORY\daily
> schedule".
>
> Ralf

Thanks

I am still on version 3 and the above does not work I'm afraid

Mike
Thu, Feb 16 2006 4:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< Just can't see how to fix this statement

SQL.Add('ALTER TABLE MEMORY "daily schedule" ' );

DBISAM does not like the multi word table name I thought I could enclose
with double quotes >>

It should work just fine.  What error are you getting ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Feb 16 2006 5:19 PMPermanent Link

"Mike Saunders"
Tim Young [Elevate Software] wrote:

> Mike,
>
> << Just can't see how to fix this statement
>
>  SQL.Add('ALTER TABLE MEMORY "daily schedule" ' );
>
>  DBISAM does not like the multi word table name I thought I could
> enclose with double quotes >>
>
> It should work just fine.  What error are you getting ?



Error message No 11949  :
SQL data type keyword expected instead found 'STRING' in table column

Note I am using DBISAM Version 3

The full procedure is

procedure ReStructureDailySchedule;
begin
 with DM.tbQuery do
 begin
   SQL.Clear;
   SQL.Add('ALTER TABLE MEMORY "Daily Schedule" ');
   SQL.Add('ADD MatColor STRING;');
   ExecSQL;
 end;
end;
Thu, Feb 16 2006 5:36 PMPermanent Link

Jeff Cook
"Mike Saunders" <mike@folleytech.co.uk> wrote on Thu, 16 Feb 2006 17:19:11 -0500

>Tim Young [Elevate Software] wrote:
>
>> Mike,
>>
>> << Just can't see how to fix this statement
>>
>> SQL.Add('ALTER TABLE MEMORY "daily schedule" ' );
>>
>> DBISAM does not like the multi word table name I thought I could
>> enclose with double quotes >>
>>
>> It should work just fine. What error are you getting ?
>
>
>
>Error message No 11949 :
>SQL data type keyword expected instead found 'STRING' in table column
>
> Note I am using DBISAM Version 3
>
>The full procedure is
>
>procedure ReStructureDailySchedule;
>begin
> with DM.tbQuery do
> begin
> SQL.Clear;
> SQL.Add('ALTER TABLE MEMORY "Daily Schedule" ');
> SQL.Add('ADD MatColor STRING;');
> ExecSQL;
> end;
>end;

Mike


I think you have to use [] or something like that - I NEVER use table or field names with spaces myself ...

SQL.Add('ALTER TABLE MEMORY [daily schedule] ' );   // This might work in v3

Cheers

Jeff
--
Jeff Cook
Aspect Systems Ltd
Phone: +64-9-424 5388
Skype: jeffcooknz
www.aspect.co.nz



Thu, Feb 16 2006 6:38 PMPermanent Link

Eryk Bottomley
Mike,

> Error message No 11949  :
> SQL data type keyword expected instead found 'STRING' in table column
<snip>
>     SQL.Add('ADD MatColor STRING;');

The error message means what it says. STRING is not a valid SQL field
type. See CHAR in the help file ...and you have to specify a fixed length.

Eryk
Fri, Feb 17 2006 11:50 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< Error message No 11949  :
SQL data type keyword expected instead found 'STRING' in table column >>

What Eryk stated is correct.  You need to use CHAR, not STRING:

procedure ReStructureDailySchedule;
begin
 with DM.tbQuery do
 begin
   SQL.Clear;
   SQL.Add('ALTER TABLE MEMORY "Daily Schedule" ');
   SQL.Add('ADD MatColor CHAR(10);');
   ExecSQL;
 end;
end;

--
Tim Young
Elevate Software
www.elevatesoft.com

Image