How to validate SQL scripts

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
parthi1705
Posts: 4
Joined: 07 May 2013 00:13

How to validate SQL scripts

#1 Post by parthi1705 » 07 May 2013 00:16

Hi,
How to Validate SQL scripts?
I am having set of sql files i wish to run one by one if there is any error at one file i need to notify to the user.I have created Bat file in-order to execute in a sequence.how to validate in bat file
say

01.sql ---Sucess
02.sql --- Fail -- intimate and not to execute rest of sql files
03.sql
04.sql

Thanks!

Endoro
Posts: 244
Joined: 27 Mar 2013 01:29
Location: Bozen

Re: How to validate SQL scripts

#2 Post by Endoro » 07 May 2013 00:56

this will only work, if your SQL program sets an exit code OR creates new tables, reports etc. in case of success.

parthi1705
Posts: 4
Joined: 07 May 2013 00:13

Re: How to validate SQL scripts

#3 Post by parthi1705 » 07 May 2013 03:11

That is what i am asking how to do so if there was an errror. Validation on the script.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: How to validate SQL scripts

#4 Post by foxidrive » 07 May 2013 03:22

Are you using SQLPlus?

parthi1705
Posts: 4
Joined: 07 May 2013 00:13

Re: How to validate SQL scripts

#5 Post by parthi1705 » 07 May 2013 03:36

The files are oracle file. I have saved in .SQL format.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: How to validate SQL scripts

#6 Post by foxidrive » 07 May 2013 03:44

How are you executing the queries?

Above you were told by Endoro that the method you use had to return an errorlevel, or test by existence of the files, and that sounds reasonable to me.

We aren't mind readers - you have to provide details for people to give advice on.

Post Reply