Hi monks!
I want to parse a CREATE-Statement, but that doesn't work. I've tried the following code:
#!/usr/bin/perl
use strict;
use warnings;
use SQL::Statement;
my $statement = qq~CREATE TABLE test(
ID int not null,
Spalte1 varchar(255),
Spalte2 int,
Spalte3 int,
Spalte4 int,
Spalte5 blob,
Spalte6 varchar(33),
primary key(ID),
)~;
my $parser = SQL::Parser->new();
my $stmt = SQL::Statement->new($statement,$parser);
But I've got the following error-message:
SQL ERROR: 'BLOB' is not a recognized data type!
So I've changed for testing the module this data type, then I got an other error-message:
SQL ERROR: Bad table or column name 'primary' is a SQL reserved word!
I'm working with perl5.8.6 and module's version 1.14
So, how can I use the module for SQL92-standard-statements? Would you use an other module?
Thank you,
Renee
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.