Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL::Translator::Producer::Sybase generates invalid CREATE TABLE statements #93

Open
mrmuskrat opened this issue Jul 13, 2017 · 0 comments

Comments

@mrmuskrat
Copy link

The SQL produced for any table with an identity column will be invalid.

[1] fake.fake.1> sp_help TestProducer;
 Name                     Owner      Object_type            Object_status              Create_date                           
 ------------------------ ---------- ---------------------- -------------------------- --------------------------------------
 TestProducer             dbo        user table              -- none --                Jul 13 2017 12:42PM                   

(1 row affected)
 Column_name            Type           Length       Prec     Scale      Nulls      Not_compressed               Default_name             Rule_name          Access_Rule_name                 Computed_Column_object                       Identity            
 ---------------------- -------------- ------------ -------- ---------- ---------- ---------------------------- ------------------------ ------------------ -------------------------------- -------------------------------------------- --------------------
 TestID                 numeric             5          9         0          0                   0               NULL                     NULL               NULL                             NULL                                                  1          
 TestVar                varchar             2       NULL      NULL          0                   0               NULL                     NULL               NULL                             NULL                                                  0          
 TestChr                char                1       NULL      NULL          1                   0               NULL                     NULL               NULL                             NULL                                                  0          
Object does not have any indexes.
No defined keys for this object.

If I have SQL::Translator::Producer::Sybase dump out the SQL for this table then I get this (comments and blank lines removed):

CREATE TABLE TestProducer (
  TestID IDENTITY numeric(9,0) NOT NULL,
  TestVar varchar(2) NOT NULL,
  TestChr char(1) NULL
);

Notice that IDENTITY falls before the datatype which is invalid, will not load in Sybase and rightly causes SQL::Translator::Parser::Sybase to error out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant