Re: 4D SQL Question

2018-01-23 Thread Jim Dorrance via 4D_Tech
Thanks, I'll try that... Jim Dorrance jim.dorra...@gmail.com 4...@dorrance.eu www.4d.dorrance.eu PS: If you know of anyone that needs an experienced 4D programmer to add energy and experience to their team, please let me know. I have experience in many areas. Reasonable rates. Remote or Paris onl

Re: 4D SQL Question

2018-01-23 Thread John DeSoi via 4D_Tech
I do something like this with Postgres: If the query returns more than X records, these rows become the starting cache. Then a second query is performed to determine the total number of rows that would be returned. The list box is a selection based listbox for a simple 1 field table where I can

Re: 4D SQL Question

2018-01-23 Thread Jim Dorrance via 4D_Tech
What I am doing now is Begin SQL SELECT * FROM [myTable] LIMIT 1 into LISTBOX :myListbox; End SQL if Records in table > 1 I then fill the rest of the arrays manually starting at goto record (1) on successive outside calls Any other ideas? -- Jim Dorrance jim.dorra...@gmail.com 4.

Re: 4D SQL Question

2018-01-23 Thread Jim Dorrance via 4D_Tech
Anybody have some hints how I could I fill a list box progressively ( LIMIT? OFFSET), or a demo DB... Thanks, Jim On Mon, Jan 22, 2018 at 7:30 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Not so dissimilar from your idea but you could do > > Begin SQL > > SELECT * FROM [myT

Re: 4D SQL Question

2018-01-23 Thread Jim Dorrance via 4D_Tech
Thank you. Perfect. On Mon, Jan 22, 2018 at 7:30 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Not so dissimilar from your idea but you could do > > Begin SQL > > SELECT * FROM [myTable] LIMIT 0 into LISTBOX :myListbox; > > End SQL > > >

Re: 4D SQL Question

2018-01-22 Thread Arnaud de Montard via 4D_Tech
> Le 22 janv. 2018 à 18:48, Jim Dorrance via 4D_Tech <4d_tech@lists.4d.com > > a écrit : > > [...]Is there a clever way to select nothing into a Listbox so that an > empty listbox with all the columns defined? I could then fill the > listbox "manually". What I do now

Re: 4D SQL Question

2018-01-22 Thread Jeffrey Kain via 4D_Tech
Just make sure you have no object fields in that table, or 4D will give you a runtime error and fail. -- Jeffrey Kain jeffrey.k...@gmail.com > On Jan 22, 2018, at 1:30 PM, Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > Not so dissimilar from your idea but you could do > > B

Re: 4D SQL Question

2018-01-22 Thread Keisuke Miyako via 4D_Tech
Not so dissimilar from your idea but you could do Begin SQL SELECT * FROM [myTable] LIMIT 0 into LISTBOX :myListbox; End SQL ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d

Re: 4D SQL Question

2018-01-22 Thread Jim Dorrance via 4D_Tech
While you are on the subject... I am a big fan of: $tSQL:="SELECT * FROM "+$tTableName+" INTO : "+$tLBox Because it creates dynamic Listbox columns automatically. Is there a clever way to select nothing into a Listbox so that an empty listbox with all the columns defined? I could then fill the

RE: 4D SQL Question

2018-01-22 Thread Stephen J. Orth via 4D_Tech
_tech@lists.4d.com> Subject: Re: 4D SQL Question DELETE FROM users WHERE id in [1,2.3]; would delete the three users with one of those ids (or none at all, if the ids didn’t exist.) DELETE FROM users WHERE last_name=“Smith”; would delete all users with t

Re: 4D SQL Question

2018-01-22 Thread Lee Hinde via 4D_Tech
DELETE FROM users WHERE id in [1,2.3]; would delete the three users with one of those ids (or none at all, if the ids didn’t exist.) DELETE FROM users WHERE last_name=“Smith”; would delete all users with the last_name of Smith. > On Jan 22, 2018, at 9:06 AM, Stephen J. Orth via 4D_Tech > <4d_

4D SQL Question

2018-01-22 Thread Stephen J. Orth via 4D_Tech
SQL newbie here... What is the correct syntax for deleting a number rows in a SQL database? Is it possible to use a 4D array which contains the values used by the WHERE clause? Or, do we have to delete each row individually? Thanks! Steve * Step