Subject | Re: Bug in Firebird 2 with IN clause statement |
---|---|
Author | roecki |
Post date | 2008-03-03T18:43:44Z |
Hi svein_erling,
thanks for taking the time.
The problem is that the query is generated by an OR-Mapper. It's not
very likely that the vendor will support the use of a stored procedure...
Zlatko Ivankovic has suggested a modified query that runs very fast. I
hope that the vendor will change the or-mapper to generate a query
like that.
Thanks,
Anton
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
thanks for taking the time.
The problem is that the query is generated by an OR-Mapper. It's not
very likely that the vendor will support the use of a stored procedure...
Zlatko Ivankovic has suggested a modified query that runs very fast. I
hope that the vendor will change the or-mapper to generate a query
like that.
Thanks,
Anton
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
>errors, I
> You can, of course, try to write a stored procedure with code along the
> lines of:
>
> for select distinct ao."ShippingAddressID" FROM "apOrders" ao
> WHERE
> ao.ID IN (243, 244, 245, 246, 247, 248, 175, 176,
> 177, 178, 179, 180, 181, 182, 183, 184, 186, 187, 188, 189,
> 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
> 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
> 215, 216, 217, 218, 219, 220) into :SAID do
> for select a.ID,
> a."EnvironmentID",
> a."eBayUserDBID" AS "EBayUserDBID",
> a."SiteID",
> a."Name",
> a."Company",
> a."Phone",
> a."Street1",
> a."Street2",
> a."CityName",
> a."StateOrProvince",
> a."Country" AS "CountryBasevalue",
> a."CountryName",
> a."PostalCode",
> a."AddressID",
> a."ExternalAddressID",
> a."AddressOwner" AS "AddressOwnerBasevalue",
> a."AddressStatus" AS "AddressStatusBasevalue",
> a."IntlName",
> a."IntlStateAndCity",
> a."IntlStreet",
> a."ts" AS "Ts",
> a."Salutation",
> a."Firstname"
> FROM "address" a
> WHERE
> a.ID = :SAID
> INTO :EnvironmentID, :eBayUserDBID... do
> SUSPEND;
>
> I hope you get the idea, even though I don't write a full stored
> procedure (and even in this tiny sample, there is likely a few
> don't write stored procedures every month and Thunderbird doesn't have
> any Firebird syntax checker as far as I know ;o).
>
> HTH,
> Set
>