parsing - Check sql script valid -


As part of a release, we load PL / SQL scripts against a database. Recently someone has written a code from the end of a line to ; left, which was called the second script, so it meant that the script did not work. Because it was not the cause of any error, it was not a part now, it took a lot of time to know what had happened.

I want to check those scripts, either ; are missing at the end or after a / , it is made more complex because 'line' in the script can actually extend more than one line if this statement Is the statement or block of.

For me it seems like this, I need to parse the scripts and then tell that they meet.

I have found and wondered if this could be a way of doing this because it seems that this is just a step to learn for a simple test.

Does anyone know an easy way or any other device, eclipse plugins etc. that I can use to check the lines in the script which is ; either end or after the / line?

Update We do most of the stuff already. Scripts are run in our test server and we have a version table that finally updates. The problem was that the missing semicircle in the container script meant that a script was not run, but there was no error with the rest to update the version number. So this problem is only raised in a way in the test. Before running the scripts with this missing semi-colon, the database was required to be restored so that the result of the default lost test would be half the day. If it was an easy way to check the first before running the script in the test server, it could save a lot of time.

I agree with MattH that you are going wrong about this. I will just add an insert statement at the end of all my scripts, insert the "version" row in the table in the database. At the end of your deployment script it is an easy task to check that it has all the correct rows in the version table.

In addition, you should run all your release scripts properly because they will be in production this is the place where all tests are conducted against your QA server. You do not do anything to the server except for your release steps - you only run the release script and if those release script is ever changed, then you refresh the QA server with them and check again.

As you have been thoroughly tested after going to the production process of your release process, as an unsuccessful safe solution, you can use tools like SQL Comparison of Red Gate and tools like SQL Data To see if the output matches the QA server. Data comparison will be compared to just a few tables (look-up tables, etc.). If you have data changes in key tables (1M rows, etc.), then you can correct the script to check that they are correct.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -