dbTalk Databases Forums  

strange sql select statement

comp.databases.oracle.server comp.databases.oracle.server


Discuss strange sql select statement in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony Johansson
 
Posts: n/a

Default strange sql select statement - 07-04-2011 , 08:32 AM






Hello!

It's a webbsite using C# and ado.net to access a oracle database.
Below is some piece 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 a 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.

Can anybody explain how this form_slag can be used in the way that it is
used ?

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

//Tony

Reply With Quote
  #2  
Old   
John Hurley
 
Posts: n/a

Default Re: strange sql select statement - 07-04-2011 , 10:27 AM






On Jul 4, 9:32*am, "Tony Johansson" <johansson.anders... (AT) telia (DOT) com>
wrote:
Quote:
Hello!

It's a webbsite using C# and ado.net to access a oracle database.
Below is some piece 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 a 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.

Can anybody explain how this form_slag can be used in the way that it is
used ?

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

//Tony
Try getting an oracle trace ( like 10046 ) and put it thru a resource
profiler like tkprof etc.

What you have included does not look like a complete SQL statement
( missing some right parens ).

It is pretty standard using variables in a plsql environment at
times. Can you define them ahead of time in C#?

Reply With Quote
  #3  
Old   
Tony Johansson
 
Posts: n/a

Default Re: strange sql select statement - 07-06-2011 , 05:24 PM



"John Hurley" <hurleyjohnb (AT) yahoo (DOT) com> skrev i meddelandet
news:cd5912f5-3c27-4898-bc7c-3d3a85d47319 (AT) p31g2000vbs (DOT) googlegroups.com...
On Jul 4, 9:32 am, "Tony Johansson" <johansson.anders... (AT) telia (DOT) com>
wrote:
Quote:
Hello!

It's a webbsite using C# and ado.net to access a oracle database.
Below is some piece 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 a 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.

Can anybody explain how this form_slag can be used in the way that it is
used ?

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

//Tony
Try getting an oracle trace ( like 10046 ) and put it thru a resource
profiler like tkprof etc.

What you have included does not look like a complete SQL statement
( missing some right parens ).

It is pretty standard using variables in a plsql environment at
times. Can you define them ahead of time in C#?

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

//Tony

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.