Skip Menu |
 

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 72624
Status: rejected
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: kr2 [...] sanger.ac.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.11010
Fixed in: (no value)



Subject: Oracle check constraint failes to parse
Download (untitled) / with headers
text/plain 683b
Hi, First fantastic job. Unfortunately I have one component of my DDL that I can't put through the converter. Using a well formed Oracle table creation statement containing a CHECK constraint exhibits the error below. CREATE TABLE TEAM_CONTACT ( TEAM NUMBER(3) NOT NULL, CONTACT_ORDER NUMBER(1) NOT NULL, CONTACT_EMAIL VARCHAR2(5) NOT NULL, IS_CURRENT NUMBER(1) DEFAULT 0 NOT NULL, CONSTRAINT PK_TEAMCONT PRIMARY KEY(TEAM,CONTACT_ORDER), CONSTRAINT UQ_TEAM_EMAIL UNIQUE(TEAM,CONTACT_EMAIL), CONSTRAINT CHK_ORD CHECK(CONTACT_ORDER > 0) ); ERROR (line 8): Invalid field: Was expecting data type but found "CHK_ORD CHECK(CONTACT_ORDER > 0)," instead Kind Regards, Keiran M Raine
Download (untitled) / with headers
text/plain 1.3k
On Tue Nov 22 11:18:21 2011, kr2@sanger.ac.uk wrote: Show quoted text
> Hi, > > First fantastic job. Unfortunately I have one component of my DDL that > I can't put through the converter. > > Using a well formed Oracle table creation statement containing a CHECK > constraint exhibits the error below. > > CREATE TABLE TEAM_CONTACT ( > TEAM NUMBER(3) NOT NULL, > CONTACT_ORDER NUMBER(1) NOT NULL, > CONTACT_EMAIL VARCHAR2(5) NOT NULL, > IS_CURRENT NUMBER(1) DEFAULT 0 NOT NULL, > CONSTRAINT PK_TEAMCONT PRIMARY KEY(TEAM,CONTACT_ORDER), > CONSTRAINT UQ_TEAM_EMAIL UNIQUE(TEAM,CONTACT_EMAIL), > CONSTRAINT CHK_ORD CHECK(CONTACT_ORDER > 0) > ); > > ERROR (line 8): Invalid field: Was expecting data type but found > "CHK_ORD CHECK(CONTACT_ORDER > 0)," instead > > Kind Regards, > > Keiran M Raine
This looks like it has been fixed ages ago (back in 2009). Here is the relevant commit: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/SQL-Translator.git;a=commit;f=lib/SQL/Translator/Parser/Oracle.pm;h=2e0b976328a216356ec080900c39bd4c4b4d13a9 In particular note how the test case is *virtually identical* to what you claim is problematic: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/SQL-Translator.git;a=blob;f=t/15oracle-parser.t;h=8cae44a73ef0af8ef440422dc837192f7c113c18;hb=HEAD#l20 I am closing this ticket, feel free to reopen it if I missed something. Cheers!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.