in reply to problems using SQL::Statement
before parsing the statement.$parser->feature('valid_data_types','BLOB',1);
If you look at SQL::Statement::Syntax, you can see that specifying the primary key (or any other constraint) at the end of the column list is not supported. You might be able to extend the parser, but I don't know how difficult that would be.
In stead, you can (in this instance) specify the primary key constraint as a column constraint. This is what works for me:
use strict; use SQL::Statement; my $statement = qq~CREATE TABLE test( ID int not null primary key, Spalte1 varchar(255), Spalte2 int, Spalte3 int, Spalte4 int, Spalte5 blob, Spalte6 varchar(33), )~; my $parser = SQL::Parser->new(); $parser->feature('valid_data_types','BLOB',1); my $stmt = SQL::Statement->new($statement,$parser);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problems using SQL::Statement
by reneeb (Chaplain) on Jul 29, 2005 at 14:35 UTC | |
by Solo (Deacon) on Jul 29, 2005 at 15:09 UTC | |
by jfroebe (Parson) on Jul 29, 2005 at 16:00 UTC | |
by reneeb (Chaplain) on Jul 29, 2005 at 16:28 UTC | |
by Solo (Deacon) on Jul 29, 2005 at 21:11 UTC |