List:General Discussion« Previous MessageNext Message »
From:Aaron P. Martinez Date:January 29 2004 8:19am
Subject:Please help with "check" syntax
View as plain text  
I am trying to set up a table from a script that came with some software
"Value accounting/CRM" and i'm getting a few errors, one of which i
can't seem to figure out/fix.  

My system is RH 3.0 ES with mysql-server-3.23.58-1.  I have innodb
tables configured with the following statement in my /etc/my.cnf:
innodb_data_file_path = ibdata1:10M:autoextend
set-variable = innodb_buffer_pool_size=70M
set-variable = innodb_additional_mem_pool_size=10M
set-variable = innodb_log_file_size=20M
set-variable = innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1


The create table statement is below followed by the error.  

create table ItemSalesTax (
         STYPE      integer not null primary key,   /* STax Type */
         SDESC      varchar(35),
         SPERC      numeric(13,4) zerofill not null /* Percentage */
                    check(SPERC >= 0),
         SCONUM     integer not null,
         SYRNO      integer not null,
         SLEVEL     varchar(4) not null, /* Access Control Level */
         constraint staxlevel_ck
                    check (SLEVEL in ('READ','RW','DENY')),
         constraint STax_fk foreign key (SCONUM, SYRNO)
                    references AccYear(ACONUM, AYEARNO)
        );



ERROR 1064: You have an error in your SQL syntax near 'check(SPERC >=
0),
         SCONUM     integer not null,
         SYRNO      i' at line 9

I am not great w/mysql but gradually learning.  I have looked in the
online manual and can't find anything that helps.
I would really like to get this going as soon as possible to
evaluate...any and all help is GREATLY appreciated.

Thanks,

Aaron Martinez

Thread
Please help with "check" syntaxAaron P. Martinez29 Jan
  • Re: Please help with "check" syntaxVictoria Reznichenko2 Feb