![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 1) See Correlated subquery 2) See column alias //Walt |
#4
| |||
| |||
|
|
"Walt" <walt_ask... (AT) yahoo (DOT) com> skrev i meddelandetnews:RhXUp.108347$GN5.67916 (AT) en-nntp-14 (DOT) 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 1) See Correlated subquery 2) See column alias //Walt Here is the complete sql statement. I have great problem to understand this sql statement because it doesn't exist any kind of comment or documentation. My opinion is that writing such sql statement without documenting is absolutely forbidden. I have a lot of questions but we can start with this one if anybody can explain how this form_slag can be used in the way that it is used ? Se more info in my earlier mail. (snip) |
#5
| |||
| |||
|
|
"Walt" <walt_ask... (AT) yahoo (DOT) com> skrev i meddelandetnews:RhXUp.108347$GN5.67916 (AT) en-nntp-14 (DOT) 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 1) See Correlated subquery 2) See column alias //Walt Here is the complete sql statement. I have great problem to understand this sql statement because it doesn't exist any kind of comment or documentation. My opinion is that writing such sql statement without documenting is absolutely forbidden. I have a lot of questions but we can start with this one if anybody can explain how this form_slag can be used in the way that it is used ? Se more info in my earlier mail. (snip) |
#6
| |||
| |||
|
|
"Charles Hooper" <hooperc2... (AT) gmail (DOT) com> skrev i meddelandetnews:8cc8133c-b171-444c-b0f3- I think that at this point the best course of direction is to throw away the SQL statement and start from scratch if either of the following is true for the SQL statement: * Performs poorly * Does not produce the expected results Hello This sql statement has given the correct result earlier but according to the customer will the result from this sql statement give wrong result. They say that nothing has been changed the .NET code is the same and the sql statement is the same but they use a new Oracle version. When a match is supposed to occur for the sql select statement we doesn't get any match ? So do you think it might be possible that two different Oracle versions could give different result for the same sql *select statement ? //Tony //Tony Now to my question do you think that two different Oracle versions could give two different results |
#7
| |||
| |||
|
|
On Jul 18, 5:31*pm, "Tony Johansson" <johansson.anders... (AT) telia (DOT) com wrote: "Charles Hooper" <hooperc2... (AT) gmail (DOT) com> skrev i meddelandetnews:8cc8133c-b171-444c-b0f3- I think that at this point the best course of direction is to throw away the SQL statement and start from scratch if either of the following is true for the SQL statement: * Performs poorly * Does not produce the expected results Hello This sql statement has given the correct result earlier but according to the customer will the result from this sql statement give wrong result. They say that nothing has been changed the .NET codeis the same and the sql statement is the same but they use a new Oracle version. When a match is supposed to occur for the sql select statement we doesn't get any match ? So do you think it might be possible that two different Oracle versions could give different result for the same sql *select statement ? //Tony //Tony Now to my question do you think that two different Oracle versions could give two different results Simply changing the Oracle release version *should not* have an impact. *That said, there are release version specific bugs for ANSI style joins - the query might have worked by coincidence in the past, and when an ANSI bug was fixed, the join order changed. *See the following two articles, which list several of the ANSI specific bugs found in Metalink (MOS) and the release versions affected:http://hoopercharles.wordpress.com/2...-outer-join-re... The best bet at this point is probably to try to completely rewrite the SQL statement once it is understood what the SQL statement is supposed to accomplish. *I suggest avoiding the ANSI sytle joins if possible and also eliminating the scalar subquery. Another thought is that some form of new bug in the PL/SQL functions has surfaced. *For example, maybe one of those PL/SQL functions referenced in the SQL statement was performing a GROUP BY operation and relying on an implicit ORDER BY, and that implicit ORDER BY no longer happens in the new 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. |
#8
| |||
| |||
|
|
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... |
![]() |
| Thread Tools | |
| Display Modes | |
| |