Re: Can somebody explain this strange sql statement

From: Charles Hooper <>
Date: Tue, 19 Jul 2011 06:01:59 -0700 (PDT)
Message-ID: <>

On Jul 18, 8:37 pm, onedbguru <> wrote:
> Looks like this guy posted this in quite a few NG and forums... Could
> be wrong, but to me it looks like he is trying to reverse-engineer
> something (some web-based app??) without a clue as to what it needs to
> do...

I performed a web search and found that the OP's SQL statement appeared on a number of websites. That said, it appears that those websites are simply copying Usenet threads onto their pages in the hope of obtaining advertisement revenue. The OP's post appears in the following Usenet threads:

It appears that the OP tried unsuccessfully to obtain help previously for this problem, and was refered back to the group.

Quoting from the first of those threads, with a date of July 4, 2011: "This sql statement is just a piece of the whole statement. If I try to write out the form_slag just before statement dataadapter.fill(datatable) the compiler will complain about not knowing
about the form_slag.
This form_slag is either defined before the sql statement is executed or
defined in the database in some way.
I far as I understand it seems to me that this form_slag is not known before
this dataadapter.fill(datatable)
so the definition must be within the database in some way.

Is it possible that the definition of this form_slag is in the database in
some way.
The .NET seems to not knowing anything about this form_slag"


If the OP is trying to execute the posted query in C# using ADO.Net,
it is possible that ADO.Net is attempting to re-write the SQL
statement into a SQL Server-like format and is confused by the ANSI
and non-ANSI joins combined with the scalar sub-query and the inline
views.  The OP might be able tell ADO.Net to handle the query as a
passthrough type query to avoid an automatic rewrite (not tested).
The following might help - of course there are probably readers on
this group that know the C# syntax off the top of their heads:

There of course is a significant difference between not being able to
execute a SQL statement and retrieving two different answers for a SQL
statement based on the Oracle Database release version.

Charles Hooper
Co-author of "Expert Oracle Practices: Oracle Database Administration
from the Oak Table"
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.
Received on Tue Jul 19 2011 - 08:01:59 CDT

Original text of this message