db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dexter195 <dexter_...@yahoo.com>
Subject sql format in *.sql files
Date Thu, 14 Feb 2008 12:20:13 GMT

Hi

I have a load of sql files that i need to be able to import into derby. 

What delimiter do i need at the end of the statements in order for derby to
see it as a seperate query. i presumed that this would be ; but this doesnt
work. I've tried all variants i can think of but none of them work.

insert into MeasurementColumn values
("test","test",1,"test",2,3,4,5,"test","test","test","test",6);
insert into MeasurementColumn values
("test1","test1",1,"test1",2,3,4,5,"test1","test1","test1","test1",6);

ERROR 42X01: Syntax error: Encountered ";" at line 2, column 129.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
	at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown
Source)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
	at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
	at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
	at com.test.CreateDatabase.insertTestData(CreateDatabase.java:153)
	at com.test.CreateDatabase.main(CreateDatabase.java:247)



If i leave it as a blank line between the statements it doesnt recogonise
the second statement.

insert into MeasurementColumn values
("test","test",1,"test",2,3,4,5,"test","test","test","test",6)
insert into MeasurementColumn values
("test1","test1",1,"test1",2,3,4,5,"test1","test1","test1","test1",6)


ERROR 42X01: Syntax error: Encountered "insert" at line 3, column 1.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
	at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown
Source)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
	at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
	at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
	at com.test.CreateDatabase.insertTestData(CreateDatabase.java:153)
	at com.test.CreateDatabase.main(CreateDatabase.java:247)

Thanks for the help
Dexter


-- 
View this message in context: http://www.nabble.com/sql-format-in-*.sql-files-tp15479296p15479296.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message