Oracle Forms Print Execute Query - oracle

I have an Oracle form which has EXECUTE_QUERY(NO_VALIDATE) in the KEY_EXEQUERY trigger.
I would like to see the what is the query been executed, how can I print the sql query?

In the Pre-Query trigger get the SYSTEM.LAST_QUERY value to get the text of the query.

Related

SQL command not properly ended on insert query

I just want to alter my datas in my table this query seems good but oracle says ORA-00933: SQL command not properly ended im new in oracle from mysql.
Here's my code:
INSERT INTO AWACSRECIPEBYWSTYPE(BFGID) VALUES(23) WHERE WSTYPE = 'CLIPBOND';
You can't put a WHERE clause on an INSERT statement in Oracle. And after looking at the MySQL documentation I don't see where you can use a WHERE clause like this in MySQL either.
Did you mean to use an UPDATE statement?
UPDATE AWACSRECIPEBYWSTYPE
SET BFGID = 23
WHERE WSTYPE = 'CLIPBOND'
???

DB::getQueryLog() not printing groupby

I have this query to be printed in normal SQL query:
Brand::get()->groupBy('name');
print_r(DB::getQueryLog());
but it is displaying only select * from brands ignoring groupBy. Why is it ignored?
You're grouping after executing the query. The correct way to see your desired result:
Brand::groupBy('name')->get();
print_r(DB::getQueryLog());
What you're doing is executing the groupBy on a Collection. This is working also but it's laravel that is grouping and not your database. That's why you won't see the groupBy command in the SQL query.
you can also use
Brand::groupBy('name')->toSql();
This will print sql query.

Dynamically logging PLSql statements in a table

I have bunch of plsql which has dynamic queries ( ie queries are framed as string and executed with immediate execute function). I want to find the dependent tables and columns for a plsql. I am planning to achieve by GSQL parser. I tried the plsql file as it is, because of dynamic queries, I am not able to get the dependency information. The alternate way is collecting the list of SQL statements executed during the plsql run. How to get sql statement for a plsql and store it a table with unit name mapping ?
Hi you need execute the sql you have saved with execute immediate;
you will get all sql in below oracle view
select * from v$sql;
select * from dba_hist_sqltext;

How do I capture the query sent to Oracle in an SSIS Package?

I have deployed an SSIS package which has a query that pulls data from oracle. The query has some variables in it and I wanted to see what variable were being inputted at run time. Is there a way maybe via sql profiler that I can capture the query that sql server is sending out to Oracle when the sql job runs?
How are these variables being 'evaluated' when the SSIS package executed? I imagine you get this from a table or generating on the 'fly'.
You have the following option :
Capture them and assign them in SSIS variable(s)
In case you are doing something complex - create a variable something like - User::SQLCommand. In this case Use expression to generate the SQL String that needs to be executed in Oracle. Use this in your OLEDB Source Editor as "Sql command from variable" to execute the statement in Oracle
Use a SQL statement to insert the variable details captured in previous step in your intended audit table
--
Please mark if this answers your question!

Linq query to perform a full text search

How can the following be done with a linq statement?
SELECT Description
FROM Production.ProductDescription
WHERE FREETEXT(Description, 'Some Keywords')
No, the full text search function FREETEXT in TSQL is not directly accessible with Linq to SQL.
You would have to execute that query directly in a database function, then you can pull your result set back with Linq to SQL.
I am not sure, but you might have to search each column/property of the table against your keyword to mimick freetext.
ex:
context.Production.ProductDescription
.Where(pd=>pd.Property1.Contains("Keyword") || pd.Property2.Contains("Keyword");

Resources