On Tue, Feb 16, 2010 at 8:34 AM, gabjos <[email protected]> wrote:

> I type: truncate table test
>


Hmmm. It works for me without any error.

create table test(i int);
truncate table test;
drop table test;

Are you SURE you're typing "truncate table test"?

Cheers
Kerry



>
> The table does exist and I own it. But I keep getting the following
> error:
>
>
> I don't know what to do. Please help.
>
> statement TRUNCATE TABLE FROM[*] test ; expected identifier; SQL
> statement:
> truncate table FROM test [42001-63]
> org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement TRUNCATE
> TABLE FROM[*] test ; expected identifier; SQL statement:
> truncate table FROM test [42001-63]
>    at org.h2.message.Message.getSQLException(Message.java:89)
>    at org.h2.message.Message.getSQLException(Message.java:93)
>    at org.h2.message.Message.getSyntaxError(Message.java:103)
>    at org.h2.command.Parser.readIdentifierWithSchema(Parser.java:
> 2263)
>    at org.h2.command.Parser.readTableOrView(Parser.java:3906)
>    at org.h2.command.Parser.parseTruncate(Parser.java:888)
>    at org.h2.command.Parser.parsePrepared(Parser.java:381)
>    at org.h2.command.Parser.parse(Parser.java:264)
>    at org.h2.command.Parser.parse(Parser.java:236)
>    at org.h2.command.Parser.prepareCommand(Parser.java:208)
>    at org.h2.engine.Session.prepareLocal(Session.java:173)
>    at org.h2.server.TcpServerThread.process(TcpServerThread.java:
> 176)
>    at org.h2.server.TcpServerThread.run(TcpServerThread.java:97)
>    at java.lang.Thread.run(Unknown Source)
>
>    at org.h2.engine.SessionRemote.done(SessionRemote.java:289)
>    at org.h2.command.CommandRemote.prepare(CommandRemote.java:54)
>    at org.h2.command.CommandRemote.<init>(CommandRemote.java:37)
>    at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:
> 237)
>    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
> 961)
>    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:143)
>    at org.h2.server.web.WebThread.getResult(WebThread.java:1392)
>    at org.h2.server.web.WebThread.query(WebThread.java:1054)
>    at org.h2.server.web.WebThread.process(WebThread.java:375)
>    at org.h2.server.web.WebThread.processRequest(WebThread.java:131)
>    at org.h2.server.web.WebThread.run(WebThread.java:158)
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<h2-database%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to