File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes end of batch indicators (';' and 'GO') Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "end of batch indicators ( Watch "end of batch indicators ( New topic

end of batch indicators (';' and 'GO')

Bill Ross

Joined: Dec 20, 2000
Posts: 4
I am building a script running utility and have a question about end of batch 'signals' in scripts that contain multiple batches. That is, symbols like ';' (semi-colon used by Oracle and DB2) or the 'GO' (used by SQL Server), used to separate multiple batches within a single script file.
Can anyone suggest how to handle multiple batches within a single script file? I would simply like to read in the script file to a string and run it, but I know this will cause the SQL statement to fail. I am figuring I will need to parse this somehow while reading in the file.
Am I on the write track? Or can someone suggest a better or simpler, or more eligant solution? Not necessarily the details, but a push in the right direction would be nice.
I agree. Here's the link:
subject: end of batch indicators (';' and 'GO')
It's not a secret anymore!