Board index » delphi » Allowing NULL values when creating DB

Allowing NULL values when creating DB

Hi,

For speed reasons I need to switch from MSSQL Server to local Paradox
or DBase for one of my applications.  I don't want to re-write all of
my code, so I am trying to figure out how to do the following with a
Paradox DB:

EditQuery.SQL.Clear;
EditQuery.SQL.Add('Create table '+EmitterBeamstableName+' (');
EditQuery.SQL.Add('Name varchar(10) NULL,');
EditQuery.SQL.Add('RowNum float)');

I always get an error with the NULL - 'Invalid use of token NULL,
RowNum Line Number: 2'

Any ideas on what I'm doing wrong?  If I can't do this during the
create, is there a way to alter the table afterwards to add this, or
does Paradox just not support NULLs?

Thanks in Advance,
Elizabeth MacKay

 

Re:Allowing NULL values when creating DB


"Elizabeth MacKay" <EMac...@northropgrumman.com> schrieb im Newsbeitrag
news:9948b555.0303181455.392dd2d0@posting.google.com...

Quote
> For speed reasons I need to switch from MSSQL Server to local Paradox
> or DBase for one of my applications.  I don't want to re-write all of
> my code, so I am trying to figure out how to do the following with a
> Paradox DB:

> EditQuery.SQL.Clear;
> EditQuery.SQL.Add('Create table '+EmitterBeamstableName+' (');
> EditQuery.SQL.Add('Name varchar(10) NULL,');
> EditQuery.SQL.Add('RowNum float)');

> I always get an error with the NULL - 'Invalid use of token NULL,
> RowNum Line Number: 2'

> Any ideas on what I'm doing wrong?  If I can't do this during the
> create, is there a way to alter the table afterwards to add this, or
> does Paradox just not support NULLs?

The help file "localsql.hlp" says nothing about NULL or NOT NULL.
(Topic "Create Table")

1.) you should carefully check the resulting SQL command:
ShowMessage(EditQuery.SQL.Text);

2.) avoid reserved names!
    "Name" could be a reserved word.
http://developer.mimer.com/validator/sql-reserved-words.tml
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsql...
ra-rz_9oj7.asp

3.) don't use Paradox or DBase; you will regret it soner or later.
    M$ SQL Server is fast enough if the server machine has > 256MB RAM
    and your application is designed properly.

Andreas

Re:Allowing NULL values when creating DB


To my knowledge, there is no support for NULL in any of the older ISAM
database formats (Paradox, dBASE, FoxPro, etc).

On 18 Mar 2003 14:55:19 -0800, EMac...@northropgrumman.com (Elizabeth

Quote
MacKay) wrote:
>Hi,

>For speed reasons I need to switch from MSSQL Server to local Paradox
>or DBase for one of my applications.  I don't want to re-write all of
>my code, so I am trying to figure out how to do the following with a
>Paradox DB:

>EditQuery.SQL.Clear;
>EditQuery.SQL.Add('Create table '+EmitterBeamstableName+' (');
>EditQuery.SQL.Add('Name varchar(10) NULL,');
>EditQuery.SQL.Add('RowNum float)');

>I always get an error with the NULL - 'Invalid use of token NULL,
>RowNum Line Number: 2'

>Any ideas on what I'm doing wrong?  If I can't do this during the
>create, is there a way to alter the table afterwards to add this, or
>does Paradox just not support NULLs?

>Thanks in Advance,
>Elizabeth MacKay

Other Threads