CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Dulplicated Sql (2 select stmts)

Print topic Send  topic

Author Message
Andrew B
Posted: 04/06/2002, 7:47 PM

I made a view in sql2k to get support case information. It was working fine at first. Then I re-gen'd the entire project after I modified the header (with a link home). Now it is asking for TWO recordsets. I am surprised it works :)

I had not touched the page since it last worked, except for the site re-gen. There is a little custom code in the before show to format the date and do something else, but nothing SQL related.

Query analyzer returns it as two diff. rowsets. If I can't figger out what is causing this, I will just re-create the page. Any ideas tho?

This is what it gives me :
select
a.ClientID as a_ClientID,
a.IssueDate as a_IssueDate,
...
a.UserName as a_UserName
from
avw_support_cases a

select
a.ClientID as a_ClientID,
a.IssueDate as a_IssueDate,
...
a.UserName as a_UserName
from
avw_support_cases a
Alex Alexapolsky
Posted: 04/08/2002, 4:23 AM

How specifically is it asking for 2 recordset ? You get any run time errors ?
Or you know that only due to query analizer ?
what about data displayed ? is it correct or duplicated ?
Andrew B
Posted: 04/08/2002, 6:43 PM

That sql statement is exactly what it gave me, except for the extra fields that I trimmed out to keep it from being 40 lines long :)

1. It is simply creating 2 identical select statements.
2. No run time errors occur
3. I thought it would error, so I ran it in QA, and it workded, just returned 2 rowsets.
4. The data displayed is correct. All the requested records are displayed in the proper order, then another copy of them is displayed below. The duplicates do not show up next to each other (but that's a sql thing)

Should be :
id/name/status
1/test 1/New
2/Test 2/Closed - User
5/Test 5/Open - Investigating

but it outputs :
id/name/status
1/test 1/New
2/Test 2/Closed - User
5/Test 5/Open - Investigating
1/test 1/New //--- start of duplicates
2/Test 2/Closed - User
5/Test 5/Open - Investigating

Since QA treats it like a batch statement, I got two seperate result panes.

I deleted the page and started over, and it worked fine. My testing with the view showed now wierd behavior. Odd. It just started generating 2 copies of the sql statement.

The only thing I can think that I could have done was 'sSql = sSql & sSQl'; I do not recall there being any custom code though.

Ah well. It has never happened before, and hasn't happened since.
Nicole
Posted: 04/09/2002, 1:49 AM

Andrew,
try to use DISCTINCT directive in sql statement
Nicole
Posted: 04/09/2002, 1:49 AM

Andrew,
try to use DISCTINCT directive in sql statement
Andrew B
Posted: 04/09/2002, 3:29 PM

Don't worry about solving this one, since I fixed it by re-creating the page.

I wasn't using custom SQL, it was CC generated code, i just formatted it. Distinct might have fixed it, but then I would have had to write custom sql for the form when I didn't need to normally. Also, since it was simply appending a copy of the query to the end, I am not sure that would have fixed anything, since I would have had two 'distinct' clauses. It seems to be the way that ado works, it doesn't return two recordsets. the code was kinda like this :

"SELECT * FROM table SELECT * FROM table"

Just thought you guys might want to know about it.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.