Install4j - Is it possible to run TSQL queries? - install4j

When working with Server-Sql, sometimes it needs to use Transact-SQL queries. Is it possible to execute it through Install4j?
EDIT
I'm using the Server SQL JDBC driver: - com.microsoft.sqlserver.jdbc.SQLServerDriver.
When I'm trying to execute the following script in the SSMS it works without any problem:
USE [${installer:DbName}]
GO
CREATE USER [Guest] FOR LOGIN [Guest]
GO
USE [${installer:acDbName}]
GO
ALTER ROLE [db_owner] ADD MEMBER [Guest]
GO
, but when executing it with the "Execute SQL script" I get the following error: com.install4j.runtime.beans.actions.jdbc.ExecuteSqlScriptAction [ID 8123]: Error executing script line "U", error message: "Could not find stored procedure 'U'."
When enabling the statement delimeter with ; I'm getting the next error:
"Incorrect syntax near 'GO'."

It depends on whether the JDBC driver that you are using can handle TSQL or not, install4j does not have support for specific databases.

Related

How to create multiple databases with Postgres in pgAdmin4

I am trying to run the following query in pgAdmin:
CREATE DATABASE abc;
CREATE DATABASE xyz;
And I get the following error:
ERROR: current transaction is aborted, commands ignored until end of transaction block
SQL state: 25P02
I'm relatively new to postgres.
With SQL Server it's possible to create multiple databases in a single query with the "GO" statement in between if necessary.
I've tried to google this error, and most answers are to simply run each line separately.
That would work, but I'm curious why this doesn't work.
It may also be a setting in pgAdmin.
The "autocommit" is currently on. I've tried it off, and same result.
I'm using postgres 14.5 (in aws)

Postgres alter system command fails using Hibernate fails

I want to make a change to the postgres.conf file at runtime. However, when I execute the sql with "alter system" via hibernate I get an error
Transaction is marked for rollback only or has timed out
I think this has something to do with alter system commands not allowed to execute inside a transaction block as per the documentation
Only superusers can use ALTER SYSTEM. Also, since this command acts directly on the file system and cannot be rolled back, it is not allowed inside a transaction block or function.
Im trying to understand if its possible to execute this type of command with hibernate and what I need to do to be able to do that?

LibreOffice Base Execute Stored Procedure/Function

I'm busy setting up a odb file with LibreOffice Base to be used with LibreOffice Calc. The odb file is working fine I can create and save regular queries but it is giving an error when I try to execute a Stored Procedure/Function. When using pgAdmin I can execute the call just fine
select * from funcProduction(current_date, current_date);
This works and returns the data expected but when I try in LibreCalc Base using Queries > Create Query in SQL View, executing the exact same call to the Stored Procedure/Function it fails with an error
Syntax error in SQL statement
I'm not sure why there's an error or even where to find what the error is
Set the query to Run SQL command directly. This is best for any engine except HSQLDB 1.8.
Related:
https://ask.libreoffice.org/en/question/133467/base-andor-syntax-w-mysql/?answer=133476#post-id-133476
sql dialect in OpenOffice Base
https://superuser.com/a/899223/541756

Make HSQLDB Compatibility with DB2

HSQL-2.3.2 is using as in-memory to test the application which is integrated DB2.
So I am setting sql.syntax_db2=true in url as below in order to provide DB2 compatibility
jdbc:hsqldb:file:{path};shutdown=true;sql.syntax_db2=true
when above url using "SET DATABASE SQL SYNTAX DB2 FALSE" statement created in generated script file,but when i am passing db2,ora syntax true as below
jdbc:hsqldb:file:{path};shutdown=true;sql.syntax_db2=true;sql.syntax_ora=true
then both statements SET DATABASE SQL SYNTAX DB2 TRUE and SET DATABASE SQL SYNTAX ORA TRUE are created and db2 syntax is not executing and below exception firing
nested exception is java.sql.SQLSyntaxErrorException: unexpected token: IGNORE
So please share where needs to make change in order to make DB2 compatibility?
Thanks,
Durgesh

MySQL Workbench 6.1 syntax errors in every statement

If I open up MySQL Workbench 6.1 on Ubuntu 14.04, and try to execute even a simple statement like
UPDATE articles SET published = 1;
It throws a syntax error when using the explain option:
Error executing explain
("You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE articles SET published = 1' at line 1", 1064)
I know there is no syntax error because I can copy and paste that exact statement into MySQL command line and it works.
Select statements are fine, but not updates or inserts. I have no idea what's wrong and it's incredibly frustrating.