D
D
Dmitry2016-04-08 16:45:10
SQL
Dmitry, 2016-04-08 16:45:10

How to select data via ADO using subquery like WITH temp AS (select a, b from table1) SELECT * FROM temp?

Friends, tell me with experience. Need to select data using subquery like WITH via ADO from Oracle.
A query to the database via WITH returns an empty set, although a direct query to the database returns the required set of data.
I found only one dubious solution on the net - to pass a query like
select * from (" & sql_variable & ")" to ADO, but for some reason it does not work. Here - Stackoverflow.com
My Source string looks like this (AutoIt):

$sSQLText = "WITH temp AS (SELECT TABLE_A.someField," & _
" TABLE_B.someField FROM TABLE_A JOIN TABLE_B " & _
" ON TABLE_A.someField = TABLE_B.someField ) SELECT * FROM temp"

Thanks in advance.
UPD: By the way, the construction of the form SELECT FROM (SELECT ...) T is also ignored ...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question