view sql generated by WSO2 DSS service - oracle

We have a very large SQL statement in our WSO2 DSS service which is executing a query against an Oracle database. With some parameters the query works. With others it fails and the Oracle error indicates there is a missing right ")" in the SQL statement. How can we see the actual SQL being sent to Oracle when the DSS executes. We've tried enabling DEBUG on any relevant looking logger and no luck.

You need to turn debug level in you DSS/Configure/Logging for
org.wso2.carbon.dataservices.core.description.query.SQLQuery
Then in Monitor/System Logs - you can see queries that was called and it's exceptions.

You can use log4jdbc to log every jdbc query that goes from DSS to Oracle. Here is a tutorial you can follow.

Related

Tibco BW SQL Direct Activity. Is it possible to run multiple statements?

I use Tibco Business Works 5.14.
I am trying to run multiple SQL statements in one "SQL Direct" activity.
Tried with Oracle (ojdbc7_12.1.0.2.jar) and MySQL(mysql-connector-java-5.1.47.jar) jdbc drivers with no luck.
Example statements:
I see similar question in tibco community forum but no clear answer https://community-dev.tibco.com/questions/multiple-statements-sql-direct-activity
Is it possible to run multiple SQL statements using "SQL Direct Activity" in tibco BW5 ?
I have found the answer:
Running multiple statements in "SQL Direct" activity problem is not related to Tibco "Direct SQL" Activity itself. it's more related to jdbc driver implementation and database settings. 
Please see Multiple queries executed in java in single statement
for running multiple statements for example in MySQL you need to add 
?allowMultiQueries=true
 to connection string
String dbUrl = "jdbc:mysql:///test?allowMultiQueries=true";
Please note that setting ?allowMultiQueries=true also making your query vulnerable to various "SQL Injection" issues. Please see example SQL injection on INSERT

GeoServer: How to log SQL query?

How to log SQL query in GeoServer?
I've tried to raise the logging level, but failed to log the SQL query.
I'm using Oracle 12c datastore.
It's painful to guess the cause of the error without the query statement that is generated by GeoServer.
As I mentioned in my comment to the OP, the VERBOSE_LOGGING profile provides detail that includes the SQL queries that GeoServer is running. The following links provide some added detail about logging in GeoServer.
Global Settings
Advanced Logging Config

How do I set the SDE version in SSIS dataflow source

I have a GIS oracle database and I am needing to reference in a SSIS dataflow task. Ideally I would normally do something like this (which works perfectly in Oracle SQL Developer):
execute sde.version_util.set_current_version('SAFE.mvedits')
SELECT CAD_EVENTID
FROM SAFE.INCIDENT_POINT_MV
however when I try to use that as the SQL command of my OLE DB Datasource it throws me an "Invalid SQL" error.
How do I set the SDE version in a SSIS dataflow task data source?
Knowing nothing of nothing on Oracle, what you might try is
In your Oracle Connection Manager, change the property RetainSameConnection to True. This means that all connections will Oracle will use the same thread.
Add an Execute SQL Task before your Data Flow that talks to Oracle. Use your query there to modify the current version thing. This setting should be persisted on the connection.
In your OLE DB Datasource, start with the SELECT statement.
You might need to set DelayValidation to true as well.
If that's not working, let me know and I'll see if I can come up with anything else.
As it turns out this is a shortfall of interacting with GIS Oracle databases through thirdparty applications. In my situation we addressed it by just bundling the change up in a stored procedure that lives on the oracle server and invoking that stored procedure from inside SSIS.

Monitor and change SQL queries with SQL Server 2000

I have a database upgrade tool that is misbehaving. I would like to catch one of the queries it sends to the database and change it before it is executed.
The tool connects via ODBC.
The tool and the SQL Server are on the same Windows 2003 Server box.
Any ideas?
EDIT: (More info)
When the tool runs it dies on step 12 out of 100. It issues some bad SQL intended to create a view. I need to suppress the error message or correct the SQL before it is executed. I can't just create the view because the first thing it does it drop the view. Even then it would error because the view would already exist.
Certainly - use the SQL Profiler to intercept and record the query.
Very useful little tool that...

How to detect SQL Server stored procedure failure from JDBC client?

I have some Java code that uses JDBC to execute a "CREATE PROCEDURE" statement on a SQL Server 2008 instance. The create proc is failing due to an error ("Implicit conversion from data type xml to varchar(max) is not allowed. Use the CONVERT function to run this query.").
This error is not being raised to the JDBC client and so I have no indication that the sproc creation failed. As far as the JDBC statement and connection are concerned, after executing the CREATE PROC statement, there were no problems.
So does anyone know how to detect this problem from the JDBC client?
TIA!
I discovered that using PreparedStatement rather than Statement gets sproc compilation warnings raised as SQLExceptions.

Resources