You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Sylvain Benoist (JIRA)" <ji...@apache.org> on 2007/10/10 15:23:50 UTC

[jira] Created: (TORQUE-104) Sybase DBMS DDL errors

Sybase DBMS DDL errors
----------------------

                 Key: TORQUE-104
                 URL: https://issues.apache.org/jira/browse/TORQUE-104
             Project: Torque
          Issue Type: Bug
          Components: Maven 2 Plugin
    Affects Versions: 3.3-RC2
         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
            Reporter: Sylvain Benoist
            Priority: Blocker


used goals torque:sql ; torque:sqlExec

When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.

Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534809 ] 

Thomas Fischer commented on TORQUE-104:
---------------------------------------

When I have time and energy, I may install Sybase. However, this may take some time.

Sylvain, did you test the templates I checked in on Sunday at all ? They should work via SqlExec (SqlExec removes the delimiter ";" before executing the sql command).

I'd guess the problem with SqlExec and your templates is that SqlExec does not know when a statement ends (it expects a ";" if you use default settings). The original ant task has the setting DelimiterType and Delimiret, which need to be set to line-based and "go" for SqlExec, but I do not know whether these settings can also be set via thwe maven 2 plugins. I will check.

> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>         Attachments: createdb.vm, sybase.zip
>
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Updated: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Sylvain Benoist (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Benoist updated TORQUE-104:
-----------------------------------

    Attachment: createdb.vm

sql/db-init/sybase/createdb.vm

> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>         Attachments: createdb.vm, sybase.zip
>
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Sylvain Benoist (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534792 ] 

Sylvain Benoist commented on TORQUE-104:
----------------------------------------

I have attached the templates as I have modified them - the sqlExec command still does not work ( I get a sqlexception for some obscure reason) but at least the generated sql can be passed on to Sybase via iSQL and it works outside of the maven2 plugin

'go' is the command delimiter for Sybase, so yes, it acts as a replacement for ';'.
I have seen that there was a delimiter param on the list of params that the maven 2 plugin takes, so I tried it
but did not succeed. I also looked at the template override feature which is advertised in the maven1 plugin but the maven2 plugin apparently does not - Tried using templatePath with no luck.

if there is any ';' in the SQL, Sybase complains and says <<Incorrect syntax near ';'>>

You can download Sybase 15.0.2 on your machine, install and use it - the developer edition is absolutely free for dev and test purposes. There are downloads for Windows, Linux and many others.

> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534614 ] 

Thomas Fischer commented on TORQUE-104:
---------------------------------------

I have removed the "comment on ..." stuff from generated sql for sybase. Can you please get the new templates from svn and check that these templates work  (I cannot check myself, I do not have sybase running)

Please confirm that I have understood the ";" correctly:
Torque's sqlExec executes the script correctly, however it cannot be fed into the sybase console directly as the sybase console does not like the ";". 
Is this correct ?

If yes, how does the sybase console tell that a command ends and a new command starts ? Is there a "go" after each statement ?

The problem with removing the semicolons is that the sqlExec task needs to know when a command ends and when the next command begins. The semicolon is used for this now, and we would need a replacement. Maybe the "go" statement can serve as such.


> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Sylvain Benoist (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537964 ] 

Sylvain Benoist commented on TORQUE-104:
----------------------------------------

The templates *do* work when submitted via SqlExec, thx.

given that there is a <delimiter> option that is available for configuration, I was wondering if the solution
would be to parameterize the templates so that instead of having in a template like index.vm, showing an explicit ';' delimiter

#foreach ($index in $table.Indices)
CREATE #if($index.Unique)UNIQUE#end INDEX $index.Name ON $table.Name ($index.ColumnList);
#end

we could replace the ';' with ($delimiter) ( assuming that $delimiter is made accessible to the velocity template engine)  ?

This way the loop would be closed - otherwise having a delimiter option that only works on the way out is limited.

> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>         Attachments: createdb.vm, sybase.zip
>
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Updated: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Sylvain Benoist (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Benoist updated TORQUE-104:
-----------------------------------

    Attachment: sybase.zip

sql/base/sybase templates

> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>         Attachments: sybase.zip
>
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Updated: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Fischer updated TORQUE-104:
----------------------------------

    Component/s:     (was: Maven 2 Plugin)
                 Generator

> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-104) Sybase DBMS DDL errors

Posted by "Sylvain Benoist (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533742 ] 

Sylvain Benoist commented on TORQUE-104:
----------------------------------------

Unless I am mistaken, I believe the changes required are in the templates jar file -

under sql/base/sybase/

comment.vm
drop.vm
table.vm
foreignkey.vm


> Sybase DBMS DDL errors
> ----------------------
>
>                 Key: TORQUE-104
>                 URL: https://issues.apache.org/jira/browse/TORQUE-104
>             Project: Torque
>          Issue Type: Bug
>          Components: Maven 2 Plugin
>    Affects Versions: 3.3-RC2
>         Environment: machine on Windows XP - used Sybase 15.0.2 Developer Edition, Maven 2.07 and plugin 3.3-RC2
>            Reporter: Sylvain Benoist
>            Priority: Blocker
>
> used goals torque:sql ; torque:sqlExec
> When the *-schema.xml file contains descriptions on tables and/or columns, the torque:sql goal generates a DDL that contains instructions like
> 'COMMENT ON TABLE blahblahblah IS 'some description' or 'COMMENT ON COLUMN blahblah IS...
> Sybase does not support these, so they should be suppressed from the output when Sybase is the target database.
> Another issue - Sybase does not like ';' in the DDL -- all it wants to see is LF/CR, and 'go' statements

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org