I met same problem, too.
RunScript execution always failed.

Exception in thread "main" org.h2.jdbc.JdbcSQLException: Sequence
"SYSTEM_SEQUENCE_A3D5D1C9_0283_46D7_9D10_617C05F892DB" already exists;
SQL statement:


On Sep 13, 9:30 pm, Michael Rudolf <[email protected]> wrote:
> Hi,
>
> it seems that my reply to the post 
> athttp://groups.google.com/group/h2-database/browse_thread/thread/61a55...
> got lost, therefore I just open another discussion with the same
> subject.
>
> I could reproduce the problem of the SCRIPT command not generating
> DROP sequence statements with the following example:
>
> CREATE TABLE TEST (
>   lfdNr int NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1,
> INCREMENT BY 1),
>   PRIMARY KEY  (lfdNr)
> );
> SCRIPT NOSETTINGS DROP TO '/home/Hausdorf/test.sql';
>
> Note that the sequence is not created explicitly but as part of the
> table. The generated file contains the following statements:
>
> ;
> CREATE USER IF NOT EXISTS "" SALT 'a27b5643def1061d' HASH
> '72e711a02b10141ba2f5b9561fbd2a1ef02fd27facb04eb85086c76131c42ba8'
> ADMIN;
> DROP TABLE IF EXISTS PUBLIC.TEST;
> CREATE SEQUENCE
> PUBLIC.SYSTEM_SEQUENCE_74A9A12C_BBF9_4FC7_B653_8B1925DD0F65 START WITH
> 1 BELONGS_TO_TABLE;
> CREATE MEMORY TABLE PUBLIC.TEST(
>     LFDNR INT DEFAULT (NEXT VALUE FOR
> PUBLIC.SYSTEM_SEQUENCE_74A9A12C_BBF9_4FC7_B653_8B1925DD0F65) NOT NULL
> NULL_TO_DEFAULT SEQUENCE
> PUBLIC.SYSTEM_SEQUENCE_74A9A12C_BBF9_4FC7_B653_8B1925DD0F65
> );
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY
> KEY(LFDNR);
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
>
> Best regards,
> Michael

-- 
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