<https://www.facebook.com/ArgusProductions/>
Because of the SQL gotcha in v12 I always have a case of statement to run
4D queries instead.
For something like what is described, I send the query to another process
and return the array of record ID's.
Allows for the query but doesn't change the selection or current record for
the current process.

I'm not saying SQL is bad, but it's just nice to have the quick ease of
flipping a switch to run native 4D.


Adam Bevan
Developer & CEO, Argus Productions Inc.
<https://www.facebook.com/ArgusProductions/>


On Wed, 18 Sep 2019 at 11:05, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Here goes
>
> C_TEXT($INCLUDED_txt)
> $INCLUDED_txt:=“(“+String(al_Personnel_ID{1})
> for($LOOPL;2;size of array(al_Personnel_ID))
>
> $INCLUDED_txt:= $INCLUDED_txt+”,”+String(al_Personnel_ID{LOOPL})
>
> end for
> $INCLUDED_txt:=$INCLUDED_txt+”)"
> begin sql
> select [Personnel].[field],...
>
> from [Personnel]
> where
> Personnel]Personnel_ID in :$INCLUDED_txt:
>
> end sql
>
> ------------------------------------------------------------------------------------------------
>  Chuck Miller Voice: (617) 739-0306
>  Informed Solutions, Inc. Fax: (617) 232-1064
>  mailto:cjmiller<AT SIGN>informed-solutions.com
>  Brookline, MA 02446 USA Registered 4D Developer
>        Providers of 4D and Sybase connectivity
>           http://www.informed-solutions.com
>
> ------------------------------------------------------------------------------------------------
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any action in
> reliance upon this transmission is strictly prohibited.  Delivery of this
> message to any person other than the intended recipient shall not
> compromise or waive such confidentiality, privilege or exemption from
> disclosure as to this communication.
>
> > On Sep 18, 2019, at 11:44 AM, Randy Engle via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Hello SQL Afficionados!
> >
> > I need to get a selection of records, based upon an array of ID numbers.
> > (What I want is to end up the arrays... not the selection of records)
> >
> > e.g.
> > QUERY WITH ARRAY([Personnel]Personnel_ID;al_Personnel_ID)
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to