DataGrip only executing first 19 lines of SQL query - google-bigquery

I'm attempting to execute a 236 line query in DataGrip in an attached BigQuery console. When I select the whole script to run, it always only executes up to the 19th line. Because of that, I get this error
[HY000][100032] [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Syntax error: Unexpected end of script at [19:49] com.simba.googlebigquery.support.exceptions.GeneralException: [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Syntax error: Unexpected end of script at [19:49]
I've tried running it as a SQL file as well, but that resulted in the same error. I Know that this query is valid because it returns the desired results when I run it directly in the Google Cloud query editor. Has anyone else run into this issue, and is there a fix?

We introduced BigQuery dialect recently and it does not apply to your previously created data source after update, since this data source was created with custom driver with 'Generic' dialect as default. It is needed to change dialect in driver options, then you'll have all related consoles and datasources with correct one.

Related

Using DBShortcut to run a jdbc query in Python in Maximo - Getting unicode error - BIRT doesn't get error so how to process the error

I am running a jdbc query and using the result set to retrieve column values.
My output goal is a csv.
I am using Jython scripting in Maximo via the automation scripts.
I notice that I frequently get errors writing lines out and in the middle of output I get missing or truncated values from the point of error.
The errors read basically:
BMXAA7837E - An error occured that prevented the BIALOCHIERREP script for the BIALOCHIERREP launch point from running.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 16: ordinal not in range(128) in at line number 224
psdi.util.MXApplicationException: BMXAA7837E - An error occured that prevented the BIALOCHIERREP script for the BIALOCHIERREP launch point from running.
It seems logical that some data coming in from the database is not UTF-8 if I am seeing this error
I know that other processes such as BIRT are able to read this very same data and get by the 'errors'
So is there a recommended way of getting by this or determining for sure whether the data is good or bad in the source database? I am currently somewhat immersed in trying to find the bad data using debug statements.
Since you are running SQL directly against the database, I would check whether your database has cast() or convert() functions you can call to do that conversion to ascii for you.

Database Error: 001003 (42000): SQL compilation error

I am getting this error when using dbt cli 0.21.1 with Snowflake:
Encountered an error: Database Error 001003 (42000): SQL compilation error: syntax error line 1 at position 31 unexpected '<EOF>'. syntax error line 1 at position 30 unexpected '.'.
... when running "dbt build". I have stripped down my models to the minimum and get the same error whatever I do. I have done "dbt clean". The results of "dbt debug" and "dbt parse" look fine.
In the dbt.log file, I can see it fails on a Snowflake command:
create schema if not exists FT.
... with the SQL compilation error message shown above.
I found the same error in the Snowflake query history, with the same command text. So I tried it by hand in the Snowflake console. Lo and behold, it works fine without the trailing period, but Snowflake produces exactly this error with that trailing period.
So it seems like dbt and Snowflake disagree about whether a SQL command should end with a period. Which one has a bug? Or is there a way to tell one or the other to change?
I forgot that I had created a generate_schema_name macro -- and it was messing up the schema name, turning it into an empty string. The create schema command was trying to create a schema named "FT." but because the schema name was blank, it ended up as "FT." -- and the trailing period confused me.
Mea culpa.
Hope this description ends up helping someone else who makes the same mistake.

Problem running embedded firebird sql query in LibreOffice

I am trying to run the following Firebird SQL query in LibreOffice, which has embedded Firebird:
SELECT RDB$GET_CONTEXT('SYSTEM', 'ENGINE_VERSION') AS "VERSION"
FROM "RDB$DATABASE";
I get the message Syntax error in SQL statement. Can anyone tell me what I am doing wrong? This works in FlameRobin, but not in LibreOffice.
The error "Syntax error in SQL statement" is a HSQLDB error. So, first, make sure your LibreOffice Base project is actually created as a Firebird Embedded project.
I was able to reproduce the error in LibreOffice Base 6.4.4.2 with a Firebird Embedded project. It looks like LibreOffice first tries to parse the query using HSQLDB (probably to be able to transform HSQLDB syntax to Firebird syntax), and only then forwards it to Firebird.
The cause of the error is the $ in RDB$GET_CONTEXT which is not a valid character in an unquoted object name in the HSQLDB SQL syntax, while it is valid in the Firebird SQL syntax. Normally, double quoting the specific object name would solve this, but RDB$GET_CONTEXT is not actually a function, but a syntax construct, so it can't be quoted in Firebird.
To be able to execute this query, you need to enable the 'Run SQL command directly' option in the SQL View, either under Edit > 'Run SQL command directly', or using the 'Run SQL command directly' button in the toolbar (database icon with >_).

"An error occurred while extracting the result into a variable of type (DBTYPE_I2)"

I am getting below error in production instance. There were no changes to the ETL and the job was running all OK everyday. Today suddenly it has started failing with error:
Source: SQL Update Audit Table Processing Execute SQL Task Description: Executing the query "UPDATE AuditTableProcessing SET ExtractRowCnt = ?..." failed with the following error: "An error occurred while extracting the result into a variable of type (DBTYPE_I2)"
When I run the job in development environment everything runs smoothly without an issue. Any hints on the issue will be much helpful!
It looks like that there are a Variable Mapped in the ResultSet of the Execute SQL Task is of type DBTYPE_I2 and the value does not fit theis type, try changing it to DBTYPE_I4 or relevant data type.
More information about ResulSet:
SSIS Basics: Using the Execute SQL Task to Generate Result Sets

Firebird select statement gives SQLSTATE = 42S02

I've made a very simple database and am trying
select * from klant;
I've verified the table exists, and last week was able to see data in it. Today however I keep getting
Statement failed, SQLSTATE = 42S02
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-KLANT
-At line 1, column 15
The same select query in flameRobin gives the following error:
Error: *** IBPP::SQLException ***
Context: Database::Statistics
Message: isc_database_info failed
SQL Message : -902
can't format message 13:98 -- message file C:\WINDOWS\SYSTEM32\firebird.msg not found
Engine Code : 335544727
Engine Message :
Error writing data to the connection.
I have copied the firebird.msg to the system32 folder so it should be able to find it there.
Any pointers toward the solution would be greatly appreciated. Similar question all seem to point toward issues with transactions, I can't see that being the problem here.
Edit:
I'm using the included ISQL tool from firebird and start the session by connecting to the database that includes my table. Same for flamerobin, first connect to database, I can see the table that i want to select from but it gives this error.
Edit2:
Finally reinstalled Firebird making sure I gave it admin right, which I think it had before, but wasn't sure about. This seems to have fixed it.