RE: 4D Selection from SQL Query

2019-02-06 Thread Randy Engle via 4D_Tech
Miyako

Many thanks again!
Works like a charm!

Took a couple of passes to see the "Double Underline" in the virtual field:  
__ROW_ID

I'm going to take a W.A.G. that this is what QUERY BY SQL command is doing 
behind the scenes.

Not sure how I'm going to use this, but I think it might come in handy at some 
point.

Thanks again,

Randy Engle,

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Keisuke Miyako via 
4D_Tech
Sent: Tuesday, February 5, 2019 4:30 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Keisuke Miyako 
Subject: Re: 4D Selection from SQL Query

alternatively, I guess we can SELECT __ROW_ID == record number (not all tables 
have a primary key).

https://doc.4d.com/4Dv17/4D/17/Replication-via-SQL.300-3786654.en.html
https://doc.4d.com/4Dv17/4D/17/CREATE-SELECTION-FROM-ARRAY.301-3729926.en.html

2019/02/06 3:31、Randy Engle via 4D_Tech 
<4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>>のメール:

If you really need it, it would be a two step process. Step one Begin sql  
select primary_key form table where (some criteria) into :$primaryKeyArray end 
sql



**
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
**

RE: 4D Selection from SQL Query

2019-02-05 Thread Randy Engle via 4D_Tech
Miyako,

Many thanks!

Randy Engle

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Keisuke Miyako via 
4D_Tech
Sent: Tuesday, February 5, 2019 4:30 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Keisuke Miyako 
Subject: Re: 4D Selection from SQL Query

alternatively, I guess we can SELECT __ROW_ID == record number (not all tables 
have a primary key).

https://doc.4d.com/4Dv17/4D/17/Replication-via-SQL.300-3786654.en.html
https://doc.4d.com/4Dv17/4D/17/CREATE-SELECTION-FROM-ARRAY.301-3729926.en.html

2019/02/06 3:31、Randy Engle via 4D_Tech 
<4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>>のメール:

If you really need it, it would be a two step process. Step one Begin sql  
select primary_key form table where (some criteria) into :$primaryKeyArray end 
sql



**
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
**

Re: 4D Selection from SQL Query

2019-02-05 Thread Keisuke Miyako via 4D_Tech
alternatively, I guess we can SELECT __ROW_ID == record number (not all tables 
have a primary key).

https://doc.4d.com/4Dv17/4D/17/Replication-via-SQL.300-3786654.en.html
https://doc.4d.com/4Dv17/4D/17/CREATE-SELECTION-FROM-ARRAY.301-3729926.en.html

2019/02/06 3:31、Randy Engle via 4D_Tech 
<4d_tech@lists.4d.com>のメール:

If you really need it, it would be a two step process. Step one Begin sql  
select primary_key form table where (some criteria) into :$primaryKeyArray end 
sql



**
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
**

RE: 4D Selection from SQL Query

2019-02-05 Thread Randy Engle via 4D_Tech
Chuck,

Many thanks!  ( I hunched that I'd hear from you on this one. )

It is as I expected:   ce n'est pas possible
Except as you showed in your example
(Which has a little bit of merit for what I'm thinking about doing)

Thanks!



Randy Engle



It is not possible. If you really need it, it would be a two step process. Step 
one Begin sql  select primary_key form table where (some criteria) into 
:$primaryKeyArray end sql

query with array([table]primary_key;$primaryKeyArray)
Don't know why you would do this except you could build sql where on the fly


BTW not creating a selection of records and not loading one is one of the 
beautiful parts of sql as you do nto need to muck with the current selection



--
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064  Informed Solutions, 
Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Server 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.
**
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
**

Re: 4D Selection from SQL Query

2019-02-05 Thread Charles Miller via 4D_Tech
It is not possible. If you really need it, it would be a two step
process. Step one
Begin sql
 select primary_key form table
where (some criteria)
into :$primaryKeyArray
end sql

query with array([table]primary_key;$primaryKeyArray)
Don't know why you would do this except you could build sql where on the fly


BTW not creating a selection of records and not loading one is one of
the beautiful parts of sql as you do nto need to muck with the current
selection

Regards

Chuck

On Tue, Feb 5, 2019 at 12:56 PM Randy Engle via 4D_Tech
<4d_tech@lists.4d.com> wrote:
>
> For you SQL aficionados
>
> I know that I can get a "selection" of 4D records using QUERY BY SQL
>
> However as a point of curiosity and interest, is it reasonably easy/possible 
> to get a selection of 4D records when using the other SQL commands
> e.g.
> Begin SQL-End SQL
> SQL EXECUTE
>
> Or, am I p...ing into the wind?
>
> Thanks!
>
> Randy Engle
>
>
> **
> 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
> **



-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Server 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.
**
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
**