Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Executing SQL commands in DataDeploy
aputnam
OpenDeploy 6.02
Unix
I have a situation where I want to issue the SQL command "SET CONSTRAINTS ALL DEFFERED" right before I deploy my content. I have tried doing this in a sql element in a deployment section with no luck. Any one know how to do this?
This is what I have:
<deployment name="CONSTRAINT">
<destinations>
<database use="jfpdb_dev">
<sql user-action="run" type="query">
SET CONSTRAINTS ALL DEFERRED
</sql>
</database>
</destinations>
</deployment>
Find more posts tagged with
Comments
Migrateduser
Two things that I can see right away...
1. You should have your query in a <[CDATA[ ... ]]> section.
2. How are you invoking DataDeploy? Please paste the command line you are using to invoke this, which may also be a problem.
aputnam
The command I am running is:
/app/OpenDeployNG/bin/iwodcmd start const.xml -k iwdd=CONSTRAINT -k iwdd-op=do-sql -k user-op=run
I have uploaded my config file for reference.
Thanks for taking a look.
Migrateduser
It looks as though you're using Informix -- is that correct?
Anyway, what result(s) are you expecting to see from this statement? It seems as though your query would yield only ephemeral results -- that is, no SELECT, UPDATE, INSERT, DELETE, CREATE or modification of any system objects.
Have you tried more tangible queries? How do you know it's not working the way it is? Your config and command line sytax look perfectly fine.
Dave
aputnam
Actually I am using oracle.
Basically my situation is that I run other deployment tasks after this. If they are run without the constraint change they willl fail.
The problem I am seeing is that when I include this constraint task, nothing happens, no DCRs are deployed and I get a 'Success'. I don't know if this is because it is not really executing or if I have something else wrong.
When I run the command and config that I included previously I get a Failure and in the log I get
DAS: Deployment : CONSTRAINT
DAS: Database Vendor set to oracle
DAS: ERROR
eployment not found
DAS: ERROR:ERROR: Unable to determine operation mode
Usually I get this error when my database.xml is not correct or some other config problem but I think everything looks correct.
Migrateduser
That type of error typically indicates that you've either specified the wrong deployment or your spec is in the wrong location (i.e. wrong directory).
Whoops -- you know, I just noticed something... take off the ".xml" suffix on your command line when referring to your spec.
aputnam
Yeah, I tried that too. no luck.
Migrateduser
So, you've tried:
/app/OpenDeployNG/bin/iwodcmd start const -k iwdd=CONSTRAINT -k iwdd-op=do-sql -k user-op=run
... and no luck?? The last thing I can think of is to make sure your const.xml spec is located in the /app/OpenDeployNG/conf directory.
Dave
aputnam
it turns out that in the database element I needed to have table="notused". It still seems I can't put it in my wrapper deployment task though, I may have to do a deploy and run or something.....