[h2] Re: PREPAREDSTATMENT - SCRIPT COLUMNS HELP

2022-09-26 Thread Sudeep C
To get insert statement like INSERT INTO TBL (A, B, C) VALUES (1, 2, 3), 
what command I have to use?

On Friday, August 9, 2019 at 7:24:48 AM UTC+5:30 Evgenij Ryazanov wrote:

> You don't need a COLUMNS clause. It only changes insert statements from 
> INSERT INTO TBL VALUES (1, 2, 3) to INSERT INTO TBL (A, B, C) VALUES (1, 2, 
> 3), it can be useful if you want to load the script into some other 
> database that don't support insert statements without names of columns.
>
>
> I only need a script with all my database inserts. 
>
> Unfortunately, H2 doesn't export such scripts. And I don't think that such 
> script will be suitable for your use case, that was described here: 
> https://groups.google.com/forum/#!topic/h2-database/1j9OAZpy5NA
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/03686324-f0ed-4cbd-bb0e-a454e7bac135n%40googlegroups.com.


[h2] Help needed for COLUMN option in SCRIPT

2022-09-26 Thread Sudeep C
How can I use COLUMN option in SCRIPT.
I'm not able to figure this

java -classpath h2-1.4.199.jar org.h2.tools.Script -url 
"jdbc:h2:file:C:\test_db" -user sa -password "" -script "backup.sql" 
-options COLUMNS

Exception in thread "main" org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax 
error in SQL statement "SCRIPT  TO 'backup.sql'  COLUMNS[*]"; SQL statement:
SCRIPT  TO 'backup.sql'  COLUMNS [42000-199]

Please help me on this topic

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/68413032-86f0-4f48-a24c-c5a490975d74n%40googlegroups.com.


[h2] Re: Help needed for COLUMN option in SCRIPT

2022-09-26 Thread Sudeep C
Is there any other option to retrieve the INSERT statement with column 
names using the above tool?

On Monday, September 26, 2022 at 9:05:29 PM UTC+5:30 Evgenij Ryazanov wrote:

> Hello!
>
> Unfortunately, this tool doesn't support all clauses of the SCRIPT 
> command. You need to use the Shell tool or H2 Console or JDBC connection to 
> the database.
>
> Valid SQL command will be SCRIPT COLUMNS TO 'backup.sql'
>
> https://h2database.com/html/commands.html#script
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/646c9ee0-2918-438a-8b6c-40888438a9ben%40googlegroups.com.


[h2] Re: Help needed for COLUMN option in SCRIPT

2022-09-26 Thread Evgenij Ryazanov
Hello!

Unfortunately, this tool doesn't support all clauses of the SCRIPT command. 
You need to use the Shell tool or H2 Console or JDBC connection to the 
database.

Valid SQL command will be SCRIPT COLUMNS TO 'backup.sql'

https://h2database.com/html/commands.html#script

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/153851f8-2f95-40f6-af28-ad792ab9179fn%40googlegroups.com.