December 23, 2004 at 10:24 am
You said the query for HugeDerivedTable has a parameter in it, which would seem to invalidate my suggestion. But, without knowing the parameter, and how it affects the derived table, I can't know that this will or won't work, so, here goes -
Can you create a view from HugeDerivedTable? Depending on what the parameter is, you might be able to leave it off, and use it in the select against the view?
By the way, I echo Kenneth's post about multiple separate selects against a derived table. Once the first select has completed, the derived table ceases to exist, so an additional query against it can't happen without recreating it. And in that sense, a temporary table or view makes sense.
Steve
December 23, 2004 at 2:59 pm
Some information for you:
I'am a Delphi developper, making a asp.net web application.
I have a two columns page: left 450 pixels and right 150 pixels width.
The colums have icons at the top (each icon has a tooltip, and a jpg)
The first 3 icons I have to show in the (small) right column.
All the others in the left column.
Which icons these are come out of a hugeDerivedTable with one parameter.
When I show the result to my boss he always wants some little changes.
So I have to change the sql once a day (till jan 1 when it must be definitive).
A view is not so easy, because changing the view is not as easy as changing the sql in my application.
And guess what my boss said today:
"I think icons in the right column was not such a good idea, put all the icons in the left column"
@&+#%*!!!
So the problem is over.
Thank to everyone for helping me.
I hope my boss stays with this idea
(but you never know with such a boss) 😉
December 23, 2004 at 3:46 pm
Henk,
That is a GREAT story and explanation! Glad is solved (at least for now!)
Thanks for letting us know!
Steve
December 27, 2004 at 2:17 am
Ah, so it was a PHB requirement behind it all..
Well, as I see it, the moral of this story is: never ever let the presentation layer decide how your data should be retrieved. That's just going to give you grief.
As for this case, now knowing the story behind it - (I have no clue of ASP or Delphi - they're just programming lingos to me) - wouldn't it have been possible to just return a single select to the webpage, and then (in code) place each row where you wanted it? Sounds to me the way to do this kind of stuff.. Anyway, glad problem is solved anyway
/Kenneth
December 27, 2004 at 2:35 am
Kenneth, you are right.
The presentation layer should be separated from the data layer.
But, I'am just surviving in the new world of asp.net.
Not knowing how to place the outcome of one sql-datareader in 2 usercontrols with a datagrid on each.
Maybe in the future?
Thanks for your help.
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply