Home » SQL & PL/SQL » SQL & PL/SQL » problems with script
icon9.gif  problems with script [message #206023] Tue, 28 November 2006 06:30 Go to next message
alexh2084
Messages: 7
Registered: November 2006
Location: Brasov
Junior Member
I have the following script:
--test script
INSERT INTO productprices(ProductID,Description) VALUES (1,'Test')
/
COMMIT
/


[sql] Failed to execute: INSERT INTO productprices(ProductID,Description) VALUES (1,' Test') / COMMIT /

.../build.xml:47: java.sql.SQLException: ORA-00933:SQL command not properly ended

I run the script using ant.

What can be the problem ? Sad
Thanks in advance for help !
Alex
Re: problems with script [message #206025 is a reply to message #206023] Tue, 28 November 2006 06:34 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
This is sqlplus syntax. (the trailing slash)
I don't know if you can run scripts like this using ant.
Re: problems with script [message #206029 is a reply to message #206025] Tue, 28 November 2006 06:39 Go to previous messageGo to next message
alexh2084
Messages: 7
Registered: November 2006
Location: Brasov
Junior Member
the "/" is only a delimiter for ant to know a statement is finished...i have similar scripts that run ok...but this i don't know
Re: problems with script [message #206040 is a reply to message #206029] Tue, 28 November 2006 07:11 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If the / is for Ant, then you probably need to append a trailing ';' to each command.
Re: problems with script [message #206044 is a reply to message #206040] Tue, 28 November 2006 07:21 Go to previous messageGo to next message
alexh2084
Messages: 7
Registered: November 2006
Location: Brasov
Junior Member
no that was not the problem...Sad
Re: problems with script [message #206045 is a reply to message #206040] Tue, 28 November 2006 07:25 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

I 've tried it in Toad with and without an "/" also with ";" it is working Nicely. You must having some other problem regarding Constraints.
Re: problems with script [message #206046 is a reply to message #206045] Tue, 28 November 2006 07:32 Go to previous messageGo to next message
alexh2084
Messages: 7
Registered: November 2006
Location: Brasov
Junior Member
its working by me also using Toad...i dont were the problem is !
Re: problems with script [message #206048 is a reply to message #206046] Tue, 28 November 2006 07:40 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Could you show the relevant snippet of the ant-build file?
Re: problems with script [message #206052 is a reply to message #206048] Tue, 28 November 2006 07:44 Go to previous messageGo to next message
alexh2084
Messages: 7
Registered: November 2006
Location: Brasov
Junior Member
here is the build file:
<!-- ==================================================================== -->
       <!-- PREPARE_JUNIT: prepare testdata for junit                            -->
       <!-- ==================================================================== -->
       <target name="prepare_junit" >
     	<echo message="Preparing junit testcase ${component.name}" />

         <echo>Loading ${component.name} test data ...</echo>
         <property file="${hibernate.props}" />
         <sql driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" classpathref="schemadoclet.classpath" 
           userid="${hibernate.connection.username}" password="${hibernate.connection.password}">
           <fileset dir="${jtest.dir}/${component.dir}">
             <include name="sql/testdata_${db.vendor}.sql" />
           </fileset>
         </sql>
       </target>
Re: problems with script [message #206056 is a reply to message #206052] Tue, 28 November 2006 08:14 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Sorry, have to guess a bit here.
According to the Ant-pages the semicolon is the default delimiter, unless you explicitly define another delimiter...
Re: problems with script [message #206061 is a reply to message #206056] Tue, 28 November 2006 08:22 Go to previous messageGo to next message
alexh2084
Messages: 7
Registered: November 2006
Location: Brasov
Junior Member
Thank you for posting.
yes according to the Ant-pages the semicolon is the default delimiter,but when i use the semicolon i receive: Invalid character error.
Re: problems with script [message #206064 is a reply to message #206061] Tue, 28 November 2006 08:43 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
check your other (working) script-build.xml combinations. Something must be different there!
(and check scripts containing more than one statement!)
Previous Topic: sequence problem
Next Topic: Help! SQL TUNING!
Goto Forum:
  


Current Time: Tue Dec 06 16:20:56 CST 2016

Total time taken to generate the page: 0.06545 seconds