Re: IS this possbile?

From: Jim Johannsen <jjsa_at_gvtc.com>
Date: Tue, 04 May 2004 19:52:44 -0500
Message-ID: <6PWlc.216$pJ4.9264_at_eagle.america.net>


Inbed a select within your storec proc select.

        Select ID, PartID, (select count(*) from xx), locations from xxx

Stephen Rybacki wrote:
> I currently have a stored proc that uses a cursor that I would like to
> replace with a different (and hopefully faster solution). The problem
> is that what I need seems to be impossible to come up with without a
> cursor. What I really need is for one of the fields in an initial
> data put to contain the results of another data pull based on fields
> in the first pull. For example:
>
> ID PartID PackingSlipNumber <OTHER FIELDS> Locations
> ===== ==== ============ =========== ==========
> 0001 ABC PS1 Other data * See
> Below
> 0001 XYZ PS1 Other data * See
> Below
>
> * This field I would like to retireive a count of all locations where
> the part/packing slip combo already exists
>
> So what I have is a Pallet that has from 1 to many parts (detail
> lines) on it. Each part has a packing slip associated with it and
> part/packing slip combos cannot be split among warehouse door
> locations. So the total locations field would then be chacked for 0
> or 1 as a value to be considered "OK".
>
> This is actually hard to describe, but if anyone has any ideas how I
> can do this sort of thing without a cursor, I'd surely appreciate it.
>
> TIA,
>
> Steve
Received on Wed May 05 2004 - 02:52:44 CEST

Original text of this message