Can't use Data Profiling Queries and Charts using airflow sqlite DB? - airflow

Installed airflow and am using the default sqlite DB. Finding that the Data Profiling Ad Hoc Query and Charts features do not work. Eg. in the Ad Hoc Query UI, setting the interpreter to sqlite_default and doing something like
select * from task_instance;
throws
Execution failed on sql ' SELECT * FROM ( select * from task_instance ) qry LIMIT 100000 ': no such table: task_instance
No data
and attempting to view the chart with label "Airflow task instance by type" throws
SELECT state, COUNT(1) as number FROM task_instance WHERE dag_id LIKE 'example%' GROUP BY state
SQL execution failed. Details: 'NoneType' object has no attribute 'get_pandas_df'
(clicking the pen icon in this screen just takes me to the mushroom cloud error screen).
Anyone know what is happening with this and how to fix while still using sqlite DB?

Be sure to put '/Users/{your_name}/airflow/airflow.db' in the host field of the Admin -> Connections.

Related

Sql Server - Select Into Linked Server

I linked an oracle db to my sql server.
I need to create a same table as linked server on my local db.
I'm trying to execute SELECT INTO query but I taking an error.
SELECT * INTO ABC_SYSUSERS FROM [OfficeOracle]..[PROJECTA].[SYSUSERS]
This is my error message.
The OLE DB provider "ORAOLEDB.Oracle" for linked server "OfficeOracle"
supplied inconsistent metadata for a column. The column "USERNAME"
(compile-time ordinal 1) of object ""PROJECTA"."SYSUSERS"" was
reported to have a "DBCOLUMNFLAGS_ISFIXEDLENGTH" of 16 at compile time
and 0 at run time.
Any solution ?
Actually, I could not fix the error which I mention above but I fixed my problem with using OPENQUERY;
SELECT * FROM OPENQUERY(LinkedServerName, 'SELECT * FROM DBName.Schema.Table')

Is there a way to log flyway "select" statements

I am using flyway to execute Oracle SQL. I can get debug statements using -x but not for select statements.
For eg: insert queries returns like below in the logs
Insert into xxx
Update count: x
But select queries didnt return any logs on outputs. I tried writing a custom slf4j logger on top of flyway but no use. Any thoughts on this please ?

Find Type of Sql Query

This is console which is communicating with MySQL Database and returning the Resultset, but in this i am not able to find the type of query . so i have to ask end user select appropriate the Query type(Drop Down Selection) before executing the Query.
is there there any way to find out nature of query so i can choose execute non-query or Data adapter to return the values.

SQLite Syntax Error In Union Select Query From MS-Access

In a brand new MS Access 2010 database, I linked to two tables from a SQLite database using an ODBC connection. I have the following union query:
SELECT Calibration_Header.Gage_ID FROM Calibration_Header
UNION SELECT CHArchive.Gage_ID FROM CHArchive;
If I execute this SQL against the same database using the sqlite3 command line application, it runs successfully and returns the proper data. When I run the query in the MS Access 2010 database, I get the following error message:
ODBC--call failed.
near "(": syntax error (1) (#1)
Other union queries against different tables get the same error message when run in MS Access. When run in the sqlite3 command line, they run successfully and return the proper data.
I suspect that a UNION SELECT is not in the standard Access vernacular. You can try implementing ANSI-92 in Access 2010 and then running your query as code, as described by Albert Kallal at http://www.utteraccess.com/forum/Create-View-Access-t1924479.html&p=1924500#entry1924500. I used these instructions to successfully create an Access "view".
I realise that this is a very old thread, but I have just had this problem and found a pretty simple solution, so thought it worth sharing in case anyone else has the problem. Although Access seems unable to run a UNION query on two linked tables, if you create a pass-through query and put the SQL for the UNION in there, it works ok. Presumably the SQL is then executed by SQLite and the results returned as a single resultset, rather than Access itself trying to apply the UNION to two separate resultsets.
I am unable to test in earlier versions, but it works in Access 2016.

Diagnostics SQL which both Oracle and MSSQL understand

We envision a Diagnostics-process in a ASP.NET WebForms application (.NET4, C#): we dispatch end-to-end a diagnostics signal from UI into the database to verify that all layers of our web-architecture are alive and well. Until now we supported Oracle and invoked
SELECT * FROM DUAL
ultimately. Going forward we will support MSSQL, we will invoke
SELECT GETDATE()
Does anyone know a universal SQL which would work on any Oracle and MSSQL instance out-of-the-box?
If all you are after is for a SQL statement to execute successfully, then you can use something benign like
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
See this link on INFORMATION_SCHEMA support
To use this query in Oracle, you will first have to create the schema and table, even if it only has 1 column with no data.. just to get count(*) working. In going that route, it may be even better to just create a dummy table and count from it rather than from INFORMATION_SCHEMA.TABLES

Resources