This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
why are you trying to do this?
if it changes slightly on every run you should create parameters to encompass those changes...
Joined: Oct 04, 2012
I m creating a swing application.In that application i m taking .sql files and running that scripts .The .sql files can contain all types sql scripts like insert,update, store procedures and functions etc...
I m not using any client program for running this scripts.
can you show us a small example of trying to create a stored procedure.
So all the program needs to do is have a string defined of the package you want to create, the connection, the jdbc commands to create the package, and the full stack trace of any exceptions that are thrown. (there is a link about this but couldn't find it)
Joined: Oct 04, 2012
I m reading the .sql file in my swing application and separating each different queries by a delimiter and executing one at a time
I given the full stored procedure create query as input to the jdbc statement and executing the statement.An executing the statement creating a store procedure in Oracle Db
with showing error symbol.After compiling the created procedure in sql client the error will gone and the procedure is executing..
What do you use as a delimiter in the SQL scripts?
You're in effect replicating SQL*plus or SQL Developer. The syntax of SQL scripts is perhaps more complicated. Generally, SQL statements are delimited by semicolons, but PL/SQL blocks are delimited by forward slashes; semicolons inside PL/SQL blocks (this includes definitions of packages and procedures) have to be passed on to the database. Moreover, SQL*plus allows you to override both delimiters, if I'm not mistaken.
My advice: write the exact text of all SQL statements as you're executing them in the database on a console or to the log file. When the exception occurs, you'll have the exact text of the statement you've executed right before. Post here that exact text of the command that is failing; without this, no one is probably able to help.