dbsrgits / sql-translator

SQL::Translator (SQLFairy)
http://sqlfairy.sourceforge.net/
82 stars 91 forks source link

Error with parser 'SQL::Translator::Parser::Sybase' #78

Open mrmuskrat opened 8 years ago

mrmuskrat commented 8 years ago

$ ~/perl5/bin/sqlt-graph --from=Sybase -o test.png test.sql

   ERROR (line 1): Invalid statement: Was expecting create table, or
                   create procedure, or create index, or create
                   constraint, or comment, or use, or setuser, or if, or
                   print, or grant, or exec

Error: translate: Error with parser 'SQL::Translator::Parser::Sybase': no results at /home/musgrom/perl5/bin/sqlt-graph line 195.

$ perl -MSQL::Translator -e 'print $SQL::Translator::VERSION, $/;' 0.11021_01

test.sql.txt

mrmuskrat commented 8 years ago

This appears to be similar in nature to issue #33.

mrmuskrat commented 7 years ago

It appears that SQL::Translator::Producer::Sybase creates SQL that SQL::Translator::Parser::Sybase cannot consume. The former creates comments like:

-- 
-- Created by SQL::Translator::Producer::Sybase
-- Created on Thu Jul 13 11:07:31 2017
-- 
--
-- Table: SomeTable
--

However SQL::Translator::Parser::Sybase only knows how to deal with C-style comments.

/* this is 
a C-Style comment
that spans multiple lines */
mrmuskrat commented 7 years ago

It looks there are more issues yet with the SQL created by SQL::Translator::Producer::Sybase. If I simply strip out all comments and blank lines SQL::Translator::Parser::Sybase fails to parse the first create table statement.