Re: Can somebody explain this strange sql statement
From: Walt <walt_askier_at_yahoo.com>
Date: Mon, 18 Jul 2011 10:19:29 -0400
Message-ID: <RhXUp.108347$GN5.67916_at_en-nntp-14.dc1.easynews.com>
On 7/18/2011 4:56 AM, Tony Johansson wrote:
> Hello!
>
> It's a webbsite using C# and ado.net to access a oracle database.
> Below is just the beginning of the sql select statement that is used and
> here you
> can see form_slag and I wonder
> how this is possible. This form_slag looks like a variable.
> If I look at this sql select statement just before dataadapter.fill is
> executed I see this form_slag just as it is in the select statement below.
> What seems very strange to me is where is the actual value for this
> form_slag is given.
> This form_slag must have a value before the dataadapter.fill is executed but
> it has not or it must be fetched from the database in some way that I don't
> understand.
>
> Note as I wrote earlier this is just the beginning of a large sql statement.
>
> I have two questions.
> 1.Can anybody explain how this form_slag can be used in the way that it is
> used ?
>
> 2. What does it mean when we have this in the select statement '2'; as
> send_ro_roles ?
>
> select distinct form_nr,
> '2;' as send_ro_roles,
> '2;' || k.kli_klia as roles_and persons,
> k.klia_namn as klient_ansvarig,
> (
> select distinct bizref_check_freq
> from bizrulereference
> where bizref_date =
> (
> select MAX(bizref_date)
> from bizrulereference
> where BIZREF_FORM_TYPE = form_slag
Date: Mon, 18 Jul 2011 10:19:29 -0400
Message-ID: <RhXUp.108347$GN5.67916_at_en-nntp-14.dc1.easynews.com>
On 7/18/2011 4:56 AM, Tony Johansson wrote:
> Hello!
>
> It's a webbsite using C# and ado.net to access a oracle database.
> Below is just the beginning of the sql select statement that is used and
> here you
> can see form_slag and I wonder
> how this is possible. This form_slag looks like a variable.
> If I look at this sql select statement just before dataadapter.fill is
> executed I see this form_slag just as it is in the select statement below.
> What seems very strange to me is where is the actual value for this
> form_slag is given.
> This form_slag must have a value before the dataadapter.fill is executed but
> it has not or it must be fetched from the database in some way that I don't
> understand.
>
> Note as I wrote earlier this is just the beginning of a large sql statement.
>
> I have two questions.
> 1.Can anybody explain how this form_slag can be used in the way that it is
> used ?
>
> 2. What does it mean when we have this in the select statement '2'; as
> send_ro_roles ?
>
> select distinct form_nr,
> '2;' as send_ro_roles,
> '2;' || k.kli_klia as roles_and persons,
> k.klia_namn as klient_ansvarig,
> (
> select distinct bizref_check_freq
> from bizrulereference
> where bizref_date =
> (
> select MAX(bizref_date)
> from bizrulereference
> where BIZREF_FORM_TYPE = form_slag
- See Correlated subquery
- See column alias
//Walt Received on Mon Jul 18 2011 - 09:19:29 CDT