Subject Re: [firebird-support] Re: FireBird SQL help
Author Wei Yu
HI, Adam

Your query is OK. but I thought the stored procedure would be excuted several times, one in the main query, the other in the sub-query, right? so if the stored procedure is slower, so the query will be slow too since it may have hundred thousands models.

William

Adam <s3057043@...> wrote: >
> HI, Adam
>
> Thanks. It looks like I have to create a temparily table to store
the data return from the stored procedure, and run the second query
against it.

Why? I posted a query that should return the correct result.

It uses aliases to use the stored procedure multiple times in the same
query. You could modify your stored procedure to take an input
parameter (modelno) if NULL, it returns your original query, otherwise
it returns the information only for that model number. If you want
further help, then you will have to display some stored procedure
source and possibly some relevant table structures.

Temporary tables are tricky in FB 1.5 in that you need to make sure you
include current_transaction in the key and remember to clean up after
yourself. Otherwise if two people run the same thing at once you are in
trouble.

Adam





++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




SPONSORED LINKS
Technical support Computer technical support Compaq computer technical support Compaq technical support Hewlett packard technical support Microsoft technical support

---------------------------------
YAHOO! GROUPS LINKS


Visit your group "firebird-support" on the web.

To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





William, Yu


---------------------------------
Yahoo! Mail - Helps protect you from nasty viruses.

[Non-text portions of this message have been removed]