Re: maven sql plugin and clobs
Hi, I'm not exactly sure how it is generated as our DB Admin is on vacation since he updates the file. About the version of Oracle we are using it is 10.2.1. I can see about escaping those values just to narrow down the issue. I'll also look into how the sqlplus option is done. Let me know if any of you can think of anything else. Thanks, Jay -- View this message in context: http://maven.40175.n5.nabble.com/maven-sql-plugin-and-clobs-tp3315695p3331402.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: maven sql plugin and clobs
How did you generate/create the clob script? I'm using clobs in mysql migrationdata imports and they work fine. I'm using mysqldump to create the sql file which correctly escapes those values. I assume you have Oracle 11? (up 2 Oracle 10 it was imo only able to export to their own bin format) LieGrue, strub --- On Wed, 12/22/10, Jason Perry jpe...@brightcove.com wrote: From: Jason Perry jpe...@brightcove.com Subject: maven sql plugin and clobs To: users@maven.apache.org Date: Wednesday, December 22, 2010, 8:38 PM Hi, I am running into a problem when trying trying to import a .sql file that has clob data. Anyone run into this or know of a workaround? Here is the failure: [INFO] [ERROR] BUILD ERROR [INFO] [INFO] ORA-06550: line 6, column 15: PLS-00103: Encountered the symbol html head meta http-equiv=Content-Type content=text/htm when expecting one of the following: ( - + case mod new not null an identifier a double-quoted delimited-identifier a bind variable avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date a string literal with character set specification a number a single-quoted SQL string pipe an alternatively-quoted string literal Thanks, -- Jay - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: maven sql plugin and clobs
I am running into a problem when trying trying to import a .sql file that has clob data. Anyone run into this or know of a workaround? Here is the Did you try escaping the quotes? The error makes me think that you could make it work if you just monkey with the clob data. Depending on how often it changes, this may or may not be an acceptable solution. I know there was talk of a sqlplus plugin at some point on this list that might be useful for you but don't know if anyone actually implemented it. Check Google and Nabble for the ml archive. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven SQL plugin
I think we can extend the configuration to support multiple filesets ( ie fileset[] ). -D On Wed, Oct 27, 2010 at 10:13 PM, Chris Odney chris.od...@gmail.com wrote: Yup, I would like to do that. However, I settled for an alternative for my project. If someone could help me with a starting point in the code(Am I asking for too much? ) I will take it from there. Thanks, Chris. On Wed, Oct 20, 2010 at 2:25 AM, Wayne Fay wayne...@gmail.com wrote: In this case, I cannot use the fileset as the ordering mechanism is alphabetical. srcFiles seems a good choice however I cannot specify wildcards :( Have you considered simply modifying the Maven SQL plugin to add the functionality you require, and then offering your changes back for inclusion in a future release of the plugin? Adding a feature like you're proposing should be relatively simple, I'd assume. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven SQL plugin
Yup, I would like to do that. However, I settled for an alternative for my project. If someone could help me with a starting point in the code(Am I asking for too much? ) I will take it from there. Thanks, Chris. On Wed, Oct 20, 2010 at 2:25 AM, Wayne Fay wayne...@gmail.com wrote: In this case, I cannot use the fileset as the ordering mechanism is alphabetical. srcFiles seems a good choice however I cannot specify wildcards :( Have you considered simply modifying the Maven SQL plugin to add the functionality you require, and then offering your changes back for inclusion in a future release of the plugin? Adding a feature like you're proposing should be relatively simple, I'd assume. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven SQL plugin
Folks, Can I specify wildcards like c:\SQLscripts\create\*.sql for the srcFile attribute within srcFiles? We have our db scripts in separate folders like create, upgrade, constraints, triggers etc. As the name says create folders has sql files that have db script to create tables, upgrade has scripts to alter the tables incase we add/remove any columns etc, constraints folder has sql scripts to add foreign key, indexes etc. Sql files within a particular folder can be executed in any order, it does not matter. However, the folders must be picked up in a predefined order, eg: create, upgrade, constraints triggers etc. In this case, I cannot use the fileset as the ordering mechanism is alphabetical. srcFiles seems a good choice however I cannot specify wildcards :( Any help? Thanks, Chris. On Fri, Oct 15, 2010 at 3:48 AM, John Singleton john.te...@gmail.comwrote: http://jira.codehaus.org/browse/MSQL-53 addresses exactly this issue... On Thu, Oct 14, 2010 at 5:12 PM, John Singleton john.te...@gmail.com wrote: Hi Chris, It has been my experience of ~2.5 years that the order is maintained with a srcFile list, though I see nothing in the plugin docs that specifically mentions this, nor have I had the time (or inclination) to read the source... We have a relatively small number of sql files, 4 in one place, 2 in another, so it is not too bad for us to list them all by name. FWIW, we are using version 1.4 of the plugin. Cheers, John On Thu, Oct 14, 2010 at 10:27 AM, Chris Odney chris.od...@gmail.com wrote: Hi John, I never noticed the option of srcFiles as against fileset My understanding is the list of files specified using srcFiles are executed in the order they are specified whereas it is not so in the case of fileset(this is when orderFile attribute is not specified). Am I wrong? Thanks for the reply, Chris. On Thu, Oct 14, 2010 at 7:33 PM, John Singleton john.te...@gmail.com wrote: Hi Chris, #2 is probably the best to ensure repeatability in the order you want. It also prevents inadvertent re-ordering if a new sql file is introduced into the sql directory. In our project, we use srcFiles rather than fileset: srcFiles srcFile[file1]/srcFile srcFile[file2}/srcFile ... /srcFiles HTH, John Singleton On Thu, Oct 14, 2010 at 9:25 AM, Chris Odney chris.od...@gmail.com wrote: Hi, I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the orderfile attribute as we specify the fileset as c:\SqlScripts\*.sql. How do I overcome this problem? I see 2 solutions: 1) Merge all scripts into one file in the creation order, the script to create role comes after the script to create user. 2)Remove the * wildcard and specify each file in the filelist attribute in the order of execution. 3)Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied) Any more elegant solutions? Thank you, Chris.
Re: Maven SQL plugin
In this case, I cannot use the fileset as the ordering mechanism is alphabetical. srcFiles seems a good choice however I cannot specify wildcards :( Have you considered simply modifying the Maven SQL plugin to add the functionality you require, and then offering your changes back for inclusion in a future release of the plugin? Adding a feature like you're proposing should be relatively simple, I'd assume. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven SQL plugin
Hi Chris, #2 is probably the best to ensure repeatability in the order you want. It also prevents inadvertent re-ordering if a new sql file is introduced into the sql directory. In our project, we use srcFiles rather than fileset: srcFiles srcFile[file1]/srcFile srcFile[file2}/srcFile ... /srcFiles HTH, John Singleton On Thu, Oct 14, 2010 at 9:25 AM, Chris Odney chris.od...@gmail.com wrote: Hi, I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the orderfile attribute as we specify the fileset as c:\SqlScripts\*.sql. How do I overcome this problem? I see 2 solutions: 1) Merge all scripts into one file in the creation order, the script to create role comes after the script to create user. 2)Remove the * wildcard and specify each file in the filelist attribute in the order of execution. 3)Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied) Any more elegant solutions? Thank you, Chris.
Re: Maven SQL plugin
Hi John, I never noticed the option of srcFiles as against fileset My understanding is the list of files specified using srcFiles are executed in the order they are specified whereas it is not so in the case of fileset(this is when orderFile attribute is not specified). Am I wrong? Thanks for the reply, Chris. On Thu, Oct 14, 2010 at 7:33 PM, John Singleton john.te...@gmail.comwrote: Hi Chris, #2 is probably the best to ensure repeatability in the order you want. It also prevents inadvertent re-ordering if a new sql file is introduced into the sql directory. In our project, we use srcFiles rather than fileset: srcFiles srcFile[file1]/srcFile srcFile[file2}/srcFile ... /srcFiles HTH, John Singleton On Thu, Oct 14, 2010 at 9:25 AM, Chris Odney chris.od...@gmail.com wrote: Hi, I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the orderfile attribute as we specify the fileset as c:\SqlScripts\*.sql. How do I overcome this problem? I see 2 solutions: 1) Merge all scripts into one file in the creation order, the script to create role comes after the script to create user. 2)Remove the * wildcard and specify each file in the filelist attribute in the order of execution. 3)Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied) Any more elegant solutions? Thank you, Chris.
RE: Maven SQL plugin
Chris and Company i tried 12 ways from sunday and I could not get this plugin.xml to work for me debug statements display NPEs on any/all references to srcFiles I discovered the srcFiles array is not initted and not allocated Source file: org.codehaus.mojo.sql.SqlExecMojo parameter namesrcFiles/name typejava.io.File[]/type requiredfalse/required editabletrue/editable descriptionList of files containing SQL statements to load./description /parameter One solution is to refactor the array to use ArrayList and reconfig on pluginXml to implement java.util.ArrayListjava.io.File does work (at least for me) parameter namesrcFiles/name typejava.util.ArrayList/type requiredfalse/required editabletrue/editable descriptionList of files containing SQL statements to load./description /parameter this is more than a 1 line change and I have other things to do..i could do a fix but then theres the test-suite to worry about any possibility to get an official response from the author? Good Catch Chris! Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Thu, 14 Oct 2010 10:03:58 -0400 Subject: Re: Maven SQL plugin From: john.te...@gmail.com To: users@maven.apache.org Hi Chris, #2 is probably the best to ensure repeatability in the order you want. It also prevents inadvertent re-ordering if a new sql file is introduced into the sql directory. In our project, we use srcFiles rather than fileset: srcFiles srcFile[file1]/srcFile srcFile[file2}/srcFile ... /srcFiles HTH, John Singleton On Thu, Oct 14, 2010 at 9:25 AM, Chris Odney chris.od...@gmail.com wrote: Hi, I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the orderfile attribute as we specify the fileset as c:\SqlScripts\*.sql. How do I overcome this problem? I see 2 solutions: 1) Merge all scripts into one file in the creation order, the script to create role comes after the script to create user. 2)Remove the * wildcard and specify each file in the filelist attribute in the order of execution. 3)Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied) Any more elegant solutions? Thank you, Chris.
Re: Maven SQL plugin
Hi Chris, It has been my experience of ~2.5 years that the order is maintained with a srcFile list, though I see nothing in the plugin docs that specifically mentions this, nor have I had the time (or inclination) to read the source... We have a relatively small number of sql files, 4 in one place, 2 in another, so it is not too bad for us to list them all by name. FWIW, we are using version 1.4 of the plugin. Cheers, John On Thu, Oct 14, 2010 at 10:27 AM, Chris Odney chris.od...@gmail.com wrote: Hi John, I never noticed the option of srcFiles as against fileset My understanding is the list of files specified using srcFiles are executed in the order they are specified whereas it is not so in the case of fileset(this is when orderFile attribute is not specified). Am I wrong? Thanks for the reply, Chris. On Thu, Oct 14, 2010 at 7:33 PM, John Singleton john.te...@gmail.com wrote: Hi Chris, #2 is probably the best to ensure repeatability in the order you want. It also prevents inadvertent re-ordering if a new sql file is introduced into the sql directory. In our project, we use srcFiles rather than fileset: srcFiles srcFile[file1]/srcFile srcFile[file2}/srcFile ... /srcFiles HTH, John Singleton On Thu, Oct 14, 2010 at 9:25 AM, Chris Odney chris.od...@gmail.com wrote: Hi, I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the orderfile attribute as we specify the fileset as c:\SqlScripts\*.sql. How do I overcome this problem? I see 2 solutions: 1) Merge all scripts into one file in the creation order, the script to create role comes after the script to create user. 2)Remove the * wildcard and specify each file in the filelist attribute in the order of execution. 3)Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied) Any more elegant solutions? Thank you, Chris.
Re: Maven SQL plugin
Hi gang, I can help with the plugin. There have been a few authors on it over the years, and there may be some gaps in coverage. Apologies for that. Would it be too difficult to get a small project in HSQL that demonstrates the issue? I don't use the plugin any more, but am happy to help out. It's probably due for a release as well. Cheers, Brian On Oct 14, 2010, at 3:44 PM, Martin Gainty wrote: Chris and Company i tried 12 ways from sunday and I could not get this plugin.xml to work for me debug statements display NPEs on any/all references to srcFiles I discovered the srcFiles array is not initted and not allocated Source file: org.codehaus.mojo.sql.SqlExecMojo parameter namesrcFiles/name typejava.io.File[]/type requiredfalse/required editabletrue/editable descriptionList of files containing SQL statements to load./description /parameter One solution is to refactor the array to use ArrayList and reconfig on pluginXml to implement java.util.ArrayListjava.io.File does work (at least for me) parameter namesrcFiles/name typejava.util.ArrayList/type requiredfalse/required editabletrue/editable descriptionList of files containing SQL statements to load./description /parameter this is more than a 1 line change and I have other things to do..i could do a fix but then theres the test-suite to worry about any possibility to get an official response from the author? Good Catch Chris! Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Thu, 14 Oct 2010 10:03:58 -0400 Subject: Re: Maven SQL plugin From: john.te...@gmail.com To: users@maven.apache.org Hi Chris, #2 is probably the best to ensure repeatability in the order you want. It also prevents inadvertent re-ordering if a new sql file is introduced into the sql directory. In our project, we use srcFiles rather than fileset: srcFiles srcFile[file1]/srcFile srcFile[file2}/srcFile ... /srcFiles HTH, John Singleton On Thu, Oct 14, 2010 at 9:25 AM, Chris Odney chris.od...@gmail.com wrote: Hi, I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the orderfile attribute as we specify the fileset as c:\SqlScripts\*.sql. How do I overcome this problem? I see 2 solutions: 1) Merge all scripts into one file in the creation order, the script to create role comes after the script to create user. 2)Remove the * wildcard and specify each file in the filelist attribute in the order of execution. 3)Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied) Any more elegant solutions? Thank you, Chris. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven SQL plugin
http://jira.codehaus.org/browse/MSQL-53 addresses exactly this issue... On Thu, Oct 14, 2010 at 5:12 PM, John Singleton john.te...@gmail.comwrote: Hi Chris, It has been my experience of ~2.5 years that the order is maintained with a srcFile list, though I see nothing in the plugin docs that specifically mentions this, nor have I had the time (or inclination) to read the source... We have a relatively small number of sql files, 4 in one place, 2 in another, so it is not too bad for us to list them all by name. FWIW, we are using version 1.4 of the plugin. Cheers, John On Thu, Oct 14, 2010 at 10:27 AM, Chris Odney chris.od...@gmail.comwrote: Hi John, I never noticed the option of srcFiles as against fileset My understanding is the list of files specified using srcFiles are executed in the order they are specified whereas it is not so in the case of fileset(this is when orderFile attribute is not specified). Am I wrong? Thanks for the reply, Chris. On Thu, Oct 14, 2010 at 7:33 PM, John Singleton john.te...@gmail.com wrote: Hi Chris, #2 is probably the best to ensure repeatability in the order you want. It also prevents inadvertent re-ordering if a new sql file is introduced into the sql directory. In our project, we use srcFiles rather than fileset: srcFiles srcFile[file1]/srcFile srcFile[file2}/srcFile ... /srcFiles HTH, John Singleton On Thu, Oct 14, 2010 at 9:25 AM, Chris Odney chris.od...@gmail.com wrote: Hi, I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the orderfile attribute as we specify the fileset as c:\SqlScripts\*.sql. How do I overcome this problem? I see 2 solutions: 1) Merge all scripts into one file in the creation order, the script to create role comes after the script to create user. 2)Remove the * wildcard and specify each file in the filelist attribute in the order of execution. 3)Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied) Any more elegant solutions? Thank you, Chris.