Re: Can somebody explain this strange sql statement

From: Charles Hooper <hooperc2001_at_gmail.com>
Date: Tue, 19 Jul 2011 06:01:59 -0700 (PDT)
Message-ID: <5e21bda0-dc0d-415f-aa26-5d0a75986ace_at_df3g2000vbb.googlegroups.com>



On Jul 18, 8:37 pm, onedbguru <onedbg..._at_yahoo.com> 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:

http://groups.google.com/group/comp.databases.oracle.server/browse_thread/thread/1fbc83657dcc5cb1
http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/8a365a3bb375d171
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/91b722acc10931

It appears that the OP tried unsuccessfully to obtain help previously for this problem, and was refered back to the comp.databases.oracle.server 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:
http://msdn.microsoft.com/en-us/library/acb32th4(v=vs.71).aspx
http://msdn.microsoft.com/en-us/library/zy8cz1kk.aspx
http://download.oracle.com/docs/cd/B28359_01/win.111/b28375/OracleDataAdapterClass.htm

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"
http://hoopercharles.wordpress.com/
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.
Received on Tue Jul 19 2011 - 08:01:59 CDT

Original text of this message