closer the alias to then use the temp ? On Tue, Jul 13, 2010 at 4:56 PM, Diego Mijelshon <[email protected]>wrote:
> I'd go for something more high level, like CTE. Example: > > with temp (select ...) > from Animal ... > > The implementation can create a #temp table *or not*. > > Diego > > > > On Tue, Jul 13, 2010 at 16:39, Fabio Maulo <[email protected]> wrote: > >> Impossible. >> Should be all in same sentence... all in one HQL >> >> On Tue, Jul 13, 2010 at 4:25 PM, José F. Romaniello < >> [email protected]> wrote: >> >>> something like this? >>> >>> #Temp = select a.Id from Animal a >>> >>> from Animals a >>> where a.Id in (select t.Id from #Temp t) >>> >>> >>> >>> >>> 2010/7/13 Fabio Maulo <[email protected]> >>> >>>> HQL syntax proposal ? >>>> >>>> >>>> On Tue, Jul 13, 2010 at 3:14 PM, Mike <[email protected]> wrote: >>>> >>>>> Yeah, that would be great. >>>>> >>>>> On Jul 13, 9:01 am, Fabio Maulo <[email protected]> wrote: >>>>> > what I mean is thishttp:// >>>>> fabiomaulo.blogspot.com/2009/05/oh-beautiful-sql.html >>>>> > >>>>> > <http://fabiomaulo.blogspot.com/2009/05/oh-beautiful-sql.html>We may >>>>> create >>>>> > a new HQL-syntax to achieve the same for SELECT queries >>>>> > >>>>> > Proposals ? >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > On Tue, Jul 13, 2010 at 10:27 AM, Mike <[email protected]> wrote: >>>>> > > I didn't realize this was possible. Are you saying that I can >>>>> create >>>>> > > the temp table in my SP, and then reference it in an HQL or >>>>> Criteria >>>>> > > query? >>>>> > >>>>> > > On Jul 12, 9:54 pm, Vadim Chekan <[email protected]> wrote: >>>>> > > > No, the funniest part is this: >>>>> > >>>>> > > > > This worked great until .. hit the limit of allowed parameters >>>>> in SQL >>>>> > > Server 2005 >>>>> > >>>>> > > > Mike, you need to predict how your code will work even before you >>>>> > > > wrote it. how much data is going to be retrieved, how many ID are >>>>> > > > going to be pushed back to sql, how much all this will take in >>>>> RAM, >>>>> > > > etc. >>>>> > > > And always run sql profiler to see what your code is doing >>>>> actually, >>>>> > > > otherwise it is source of horror stories :) >>>>> > >>>>> > > > I would rather keep SP as SP. Leave data managing task to SQL >>>>> Server, >>>>> > > > it is good with it. Without knowing details of your application, >>>>> I >>>>> > > > would try to modify existing SP so that besides select, it >>>>> creates a >>>>> > > > temporary table with selected IDs. Then you can select your >>>>> related >>>>> > > > objects as "select * from MyRelatedObjects where ID in (select ID >>>>> from >>>>> > > > #temp)". >>>>> > > > As a bonus you avoid ID roundtrip which will improve speed. >>>>> > >>>>> > > > Vadim. >>>>> > >>>>> > > > On Jul 12, 8:00 am, José F. Romaniello <[email protected]> >>>>> wrote: >>>>> > >>>>> > > > > This is the funny part: >>>>> > >>>>> > > > > 2010/7/12 Mike <[email protected]> >>>>> > >>>>> > > > > > At this point I do not have a business case to >>>>> > > > > > rewrite this Stored Procedure using NHibernate >>>>> > >>>>> > > > > If this is not a "business case to rewrite the sp with NH", >>>>> then you >>>>> > > will >>>>> > > > > have to change your SP..... >>>>> > > > > forget about selecting with a list of ids. >>>>> > >>>>> > > -- >>>>> > > You received this message because you are subscribed to the Google >>>>> Groups >>>>> > > "nhusers" group. >>>>> > > To post to this group, send email to [email protected]. >>>>> > > To unsubscribe from this group, send email to >>>>> > > [email protected]<nhusers%[email protected]> >>>>> <nhusers%[email protected]<nhusers%[email protected]>> >>>>> > > . >>>>> > > For more options, visit this group at >>>>> > >http://groups.google.com/group/nhusers?hl=en. >>>>> > >>>>> > -- >>>>> > Fabio Maulo >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "nhusers" group. >>>>> To post to this group, send email to [email protected]. >>>>> To unsubscribe from this group, send email to >>>>> [email protected]<nhusers%[email protected]> >>>>> . >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/nhusers?hl=en. >>>>> >>>>> >>>> >>>> >>>> -- >>>> Fabio Maulo >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "nhusers" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]<nhusers%[email protected]> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/nhusers?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "nhusers" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<nhusers%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/nhusers?hl=en. >>> >> >> >> >> -- >> Fabio Maulo >> >> -- >> You received this message because you are subscribed to the Google Groups >> "nhusers" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<nhusers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
