Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-26 Thread MB Software Solutions, LLC
ng the record pointer is also trying to lock the row. Do you have SET MULTILOCKS ON? -- rk -Original Message- From: ProfoxTech On Behalf Of Richard Kaye Sent: Thursday, October 22, 2020 3:28 PM To: profoxt...@leafe.com Subject: RE: COUNT FOR hangs on record locking, but SQL -

Re: AW: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-26 Thread MB Software Solutions, LLC
-Ursprüngliche Nachricht- Von: ProFox Im Auftrag von Stephen Russell Gesendet: Montag, 26. Oktober 2020 02:01 An: ProFox Email List Betreff: Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? The example was to do a count(*) in VFP. You don't have

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-26 Thread Stephen Russell
. Oktober 2020 02:01 > An: ProFox Email List > Betreff: Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) > works with no issue. Why? > > The example was to do a count(*) in VFP. You don't have these system > tables. > > SELECT SCHEMA_NAME(schema_id) AS [Schem

AW: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-26 Thread Jürgen Wondzinski
Montag, 26. Oktober 2020 02:01 An: ProFox Email List Betreff: Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? The example was to do a count(*) in VFP. You don't have these system tables. SELECT SCHEMA_NAME(schema_id) AS [SchemaName], [Tables].name AS [Tab

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-25 Thread Stephen Russell
sn't need to move the record > pointer > >> in the source table. And I'll return to how your environment is setup. > I'd > >> have to go read the fine docs to understand why moving the record > pointer > >> is also trying to lock the row. Do you have SET MULT

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-24 Thread MB Software Solutions, LLC
hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? Leaving aside the environment stuff like SET EXCLUSIVE and SET MULTILOCKS, my first guess is COUNT FOR actually moves the record pointer through every row in the table, Whereas SELECT COUNT() is reading the

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-24 Thread Christof Wollenhaupt
Thanks, it makes sense not to reveal true identities. gl is "general ledger"? > On 24. Oct 2020, at 18:04, Stephen Russell wrote: > > glTable600 was replacing the true table name because we don't state true > identities. It is our gl transaction table and it is a beast in size. ---

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-24 Thread Stephen Russell
glTable600 was replacing the true table name because we don't state true identities. It is our gl transaction table and it is a beast in size. On Sat, Oct 24, 2020 at 10:43 AM Christof Wollenhaupt < chris...@wollenhaupt.org> wrote: > SQL server works completely differently from FoxPro. For Sql

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-24 Thread Christof Wollenhaupt
SQL server works completely differently from FoxPro. For Sql Server the performance even on the same system would heavily depend on the isolation level you use, concurrent access and memory usage. I've consulted on SQL server databases projects in the close to a TB database size range where

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-24 Thread Stephen Russell
f Richard > Kaye > > Sent: Thursday, October 22, 2020 3:28 PM > > To: profoxt...@leafe.com > > Subject: RE: COUNT FOR hangs on record locking, but SQL - SELECT > COUNT(*) works with no issue. Why? > > > > Leaving aside the environment stuff like SET EXCLUSIVE and SET

Re: AW: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-23 Thread MB Software Solutions, LLC
Auftrag von MB Software Solutions, LLC Gesendet: Donnerstag, 22. Oktober 2020 21:24 An: ProFox Email List Betreff: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? VFP9SP3 Why would a COUNT FOR hang ("Attempting to lock") whereas my easy workaround

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-23 Thread MB Software Solutions, LLC
To: profoxt...@leafe.com Subject: Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? The WHERE clause was something to count but I don't think it was optimizable because no index based on it.  (Vague recollection; not 100% sure.) SET MULTILOCKS

AW: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-23 Thread Jürgen Wondzinski
. Oktober 2020 21:24 An: ProFox Email List Betreff: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? VFP9SP3 Why would a COUNT FOR hang ("Attempting to lock") whereas my easy workaround is SELECT COUNT(*) FROM SomeCursor WHERE <>

RE: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-23 Thread Richard Kaye
: ProfoxTech On Behalf Of MB Software Solutions, LLC Sent: Friday, October 23, 2020 3:24 PM To: profoxt...@leafe.com Subject: Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? The WHERE clause was something to count but I don't think it was optimizable

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-23 Thread MB Software Solutions, LLC
-Original Message- From: ProfoxTech On Behalf Of Richard Kaye Sent: Thursday, October 22, 2020 3:28 PM To: profoxt...@leafe.com Subject: RE: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? Leaving aside the environment stuff like SET EXCLUSIVE and SET

RE: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-22 Thread Richard Kaye
is also trying to lock the row. Do you have SET MULTILOCKS ON? -- rk -Original Message- From: ProfoxTech On Behalf Of Richard Kaye Sent: Thursday, October 22, 2020 3:28 PM To: profoxt...@leafe.com Subject: RE: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works

Re: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-22 Thread MB Software Solutions, LLC
: Thursday, October 22, 2020 3:24 PM To: profoxt...@leafe.com Subject: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? VFP9SP3 Why would a COUNT FOR hang ("Attempting to lock") whereas my easy workaround is SELECT COUNT(*) FROM SomeCursor WHERE  &l

RE: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-22 Thread Richard Kaye
Solutions, LLC Sent: Thursday, October 22, 2020 3:24 PM To: profoxt...@leafe.com Subject: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why? VFP9SP3 Why would a COUNT FOR hang ("Attempting to lock") whereas my easy workaround is SELECT COU

COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?

2020-10-22 Thread MB Software Solutions, LLC
VFP9SP3 Why would a COUNT FOR hang ("Attempting to lock") whereas my easy workaround is SELECT COUNT(*) FROM SomeCursor WHERE  <>   ?? tia, --Mike -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

RE: [NF] SQL SELECT to LINQ

2016-01-08 Thread Paul Newton
} Paul -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Ajit Abraham Sent: 07 January 2016 18:59 To: profoxt...@leafe.com Subject: Re: [NF] SQL SELECT to LINQ Hello Paul, Maybe this means that for some master records, there are no child records

Re: [NF] SQL SELECT to LINQ

2016-01-08 Thread Ed Leafe
On Jan 7, 2016, at 11:35 AM, Kurt Wendt wrote: > VERY Old Fox system Redundant? :-P -- Ed Leafe --- StripMime Report -- processed MIME parts --- multipart/signed text/plain (text body -- kept) application/pgp-signature ---

Re: [NF] SQL SELECT to LINQ

2016-01-08 Thread Stephen Russell
On Fri, Jan 8, 2016 at 7:25 AM, Ed Leafe wrote: > On Jan 7, 2016, at 11:35 AM, Kurt Wendt wrote: > > > VERY Old Fox system > > Redundant? :-P > > > --- Rimshot! Ed is here all week! -- Stephen Russell Sr. Analyst Ring Container Technology

RE: [NF] SQL SELECT to LINQ

2016-01-07 Thread Paul Newton
Many, many thanks Ajit that worked once I changed on a.cn_ref = b.ct_ref to on a.cn_ref equals b.ct_ref Paul -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Ajit Abraham Sent: 07 January 2016 09:38 To: profoxt...@leafe.com Subject: Re: [NF] SQL

Re: [NF] SQL SELECT to LINQ

2016-01-07 Thread Ajit Abraham
oun...@leafe.com] On Behalf Of Ajit Abraham Sent: 07 January 2016 09:38 To: profoxt...@leafe.com Subject: Re: [NF] SQL SELECT to LINQ Hello Paul, One possible solution from stackoverflow bit.ly/1TGzfLp from a in cn_ref join b in cn_desc on a.cn_ref = b.ct_ref group new {a.cn_ref, a.cn_desc, b.ct_q

[NF] SQL SELECT to LINQ

2016-01-06 Thread Paul Newton
Hi all I am just starting out with LINQ and am struggling a bit so I wondered if any kind could help me out with converting the following to LINQ select cn_ref, cn_desc, sum(ct_quan) as Quantity from cname join ctran on cn_ref=ct_ref group by cn_ref,cn_desc order by cn_ref Any offers of

RE: File In Use on USE during SQL SELECT Execution

2015-07-22 Thread Gene Wirchenko
At 13:29 2015-07-20, Richard Kaye rk...@invaluable.com wrote: I should have said effectively rather than really, Gene. Of course, I made my comment based on certain assumptions that don't necessarily line up with your framework design. It has nothing to do with my framework. My code is

RE: File In Use on USE during SQL SELECT Execution

2015-07-22 Thread Richard Kaye
At least one more. :-) -- rk -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Gene Wirchenko Sent: Wednesday, July 22, 2015 1:25 PM To: profoxt...@leafe.com Subject: RE: File In Use on USE during SQL SELECT Execution At 13:29 2015-07-20, Richard

RE: File In Use on USE during SQL SELECT Execution

2015-07-20 Thread Gene Wirchenko
At 18:16 2015-07-17, Richard Kaye rk...@invaluable.com wrote: He's really parameter checking with that TYPE test, not checking that the alias is USED. No. If the alias is not in use, the type() call returns U. If the alias is in use, the type() call returns C. [snip]

Re: File In Use on USE during SQL SELECT Execution

2015-07-20 Thread Gene Wirchenko
At 02:50 2015-07-18, Alan Bourke alanpbou...@fastmail.fm wrote: Just keep a list of the aliases you used when you opened the tables, say in an array aTables, or a collection,and when you want to close them iterate through the list and do something like: for i = 1 to alen(aTables, 1) use in

Re: File In Use on USE during SQL SELECT Execution

2015-07-20 Thread Gene Wirchenko
At 17:19 2015-07-17, Ken Dibble krdib...@stny.rr.com wrote: [snip] This is kind of similar to what my query class does to clean up after itself. However, my class keeps track of tables/work areas that were open before the query was run, and only closes those that the query itself opened.

RE: File In Use on USE during SQL SELECT Execution

2015-07-20 Thread Richard Kaye
Sent: Monday, July 20, 2015 1:36 PM To: profoxt...@leafe.com Subject: RE: File In Use on USE during SQL SELECT Execution At 18:16 2015-07-17, Richard Kaye rk...@invaluable.com wrote: He's really parameter checking with that TYPE test, not checking that the alias is USED

Re: File In Use on USE during SQL SELECT Execution

2015-07-19 Thread Ted Roche
On Sat, Jul 18, 2015 at 8:29 PM, Ken Dibble krdib...@stny.rr.com wrote: And below is how my email client rendered your response. :) Makes your point perfectly. You can of course view the post in all its glory in the Leafe archives: http://leafe.com/archives/msg/500627 Yes, I understand the

Re: File In Use on USE during SQL SELECT Execution

2015-07-18 Thread Alan Bourke
Just keep a list of the aliases you used when you opened the tables, say in an array aTables, or a collection,and when you want to close them iterate through the list and do something like: for i = 1 to alen(aTables, 1) use in select(aTables[i]) endfor If the alias is opened, it'll close it.

Re: File In Use on USE during SQL SELECT Execution

2015-07-18 Thread Man-wai Chang
I don't wanna offend anyone, but are you sure that your framework is PERFECTO? How many expert Foxpro programmers had tested your framework? :) On Sat, Jul 18, 2015 at 11:13 PM, Ken Dibble krdib...@stny.rr.com wrote: My query class does keep such a list. I wrote the framework code about ten

Re: File In Use on USE during SQL SELECT Execution

2015-07-18 Thread Ken Dibble
for i = 1 to alen(aTables, 1) use in select(aTables[i]) endfor If the alias is opened, it'll close it. If not, no errors or anything will happen, it will just continue. No type checking or any further complication required. My query class does keep such a list. I wrote the framework code

Re: File In Use on USE during SQL SELECT Execution

2015-07-18 Thread Ted Roche
On Fri, Jul 17, 2015 at 2:31 PM, Ken Dibble krdib...@stny.rr.com wrote: For some definition of fine and some definition of plain text. All email is encoded in some fashion. If you use a device or a service that inserts UTF-8 or some other double-byte encoding, or HTML-like punctuation

Re: File In Use on USE during SQL SELECT Execution

2015-07-18 Thread Ken Dibble
I don't wanna offend anyone, but are you sure that your framework is PERFECTO? How many expert Foxpro programmers had tested your framework? :) Huh? The framework was developed for a specialized purpose specific to the industry I work in. It's not a general-purpose framework. It's not for

Re: File In Use on USE during SQL SELECT Execution

2015-07-18 Thread Ken Dibble
And below is how my email client rendered your response. :) I didn't post a plain text file because my go-to for simple word processing tasks is WordPad. (I don't like Notepad because it doesn't persist any of my preferences. Wordpad by default supplies margins. Wordpad can't persist tab

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Richard Kaye
READWRITE can also be used to guarantee you are not getting a filtered view. -- rk -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Charlie Sent: Thursday, July 16, 2015 7:22 PM To: profoxt...@leafe.com Subject: Re: File In Use on USE during SQL

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
So - I'm curious. I know below you mentioned you talked to the user about the issue. And, sorry if you mentioned it in another response. But, is the error repeatable? Were you able to confirm the exact steps a user took - that would cause the error - and you can successfully make the error

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Kurt Wendt
] On Behalf Of Ken Dibble Sent: Friday, July 17, 2015 9:40 AM To: profoxt...@leafe.com Subject: RE: File In Use on USE during SQL SELECT Execution So - I'm curious. I know below you mentioned you talked to the user about the issue. And, sorry if you mentioned it in another response. But, is the error

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Kurt Wendt
... -K- -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Ken Dibble Sent: Thursday, July 16, 2015 12:20 PM To: profoxt...@leafe.com Subject: Re: File In Use on USE during SQL SELECT Execution USED() only tells you if an ALIAS name is used, not a table

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Kurt Wendt
out to be quite an extensive message thread... -K- -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Ken Dibble Sent: Wednesday, July 15, 2015 10:08 AM To: profoxt...@leafe.com Subject: Re: File In Use on USE during SQL SELECT Execution In one

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
by the query after the query runs. Some time ago I read somewhere (I can't remember) that VFP may open some tables in a work area called QUERY when running a SQL SELECT query without an INTO clause. If there are more than one of these, a digit is appended to QUERY. (In testing I see

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Dave Crozier
Can't get anything on that link - File not Found, even when I manually type it. Dave -Original Message- From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Ken Dibble Sent: 16 July 2015 17:41 To: profox@leafe.com Subject: Re: File In Use on USE during SQL SELECT Execution I'm

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
READWRITE can also be used to guarantee you are not getting a filtered view. Thank you Richard. Please see my response to Charlie, below. The query in the described scenario contains a JOIN and does not produce a filtered view. Ken ___ Post

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
This may not be relevant but you can get all sorts of horrors if you have a dangling private datasession with open cursors. Thank you Laurie. Please see my response to Charlie. I don't use any private datasessions. Ken ___ Post Messages to:

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ted Roche
On Fri, Jul 17, 2015 at 11:32 AM, Ken Dibble krdib...@stny.rr.com wrote: My previous understanding was that if there is a WHERE clause or an ORDER BY clause in the query, then VFP always creates the temp file on disk. My belief is very similar to yours, but a little different. If the SQL

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Dave Crozier
during SQL SELECT Execution Try replacing the space before the 3 with the percentsign-two-zero, On Fri, Jul 17, 2015 at 3:23 AM, Dave Crozier da...@flexipol.co.uk wrote: Can't get anything on that link - File not Found, even when I manually type it. Dave -Original Message- From

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ted Roche
...@leafe.com] On Behalf Of Ken Dibble Sent: 16 July 2015 17:41 To: profox@leafe.com Subject: Re: File In Use on USE during SQL SELECT Execution I'm about to post a very long message providing excruciating detail about this. Which, apparently, is hung up in the spam filter. *sigh* If anyone

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Laurie Alvey
-Original Message- From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Ken Dibble Sent: 16 July 2015 17:41 To: profox@leafe.com Subject: Re: File In Use on USE during SQL SELECT Execution I'm about to post a very long message providing excruciating detail about this. Which

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Gene Wirchenko
At 10:04 2015-07-16, Ted Roche tedro...@gmail.com wrote: RTF? How... quaint. VFP? How... quaint. I use tools that work. What should quaintness have to do with it? [snip] Sincerely, Gene Wirchenko ___ Post Messages to:

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ted Roche
RTF is an MS proprietary, though unusually well-documented, format for pretty fonts and styles. It requires a word processor to read. Ken's document contained no styles that I could discern, won't be added to the ProFox list archives, and perhaps may even be unreadable by future generations of

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Gene Wirchenko
: 2000-08-29 * * Tables opened for reading by SQL select commands might not be closed. * At least, this is the behaviour (undocumented and subject to change) * currently exhibited (VFP 5 SP 3). This procedure looks for the default * alias and closes the table. This should not interfere

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Kurt Wendt
Dibble Sent: Friday, July 17, 2015 2:31 PM To: profoxt...@leafe.com Subject: Re: File In Use on USE during SQL SELECT Execution I live in a 90 year old craftsman bungalow, ride a 28-year-old steel bicycle and wear geeky computer clothes from the 90s. I have nothing against quaint. Just noting

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
Our email medium here at Profox, otoh, is plain text. It appear fine in a browser, an email client, even emacs! For some definition of fine and some definition of plain text. All email is encoded in some fashion. If you use a device or a service that inserts UTF-8 or some other double-byte

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
procedure closeforsql lparameters thealias if type(alias(thealias))#T_U use in (thealias) endif return endproc This is kind of similar to what my query class does to clean up after itself. However, my class keeps track of tables/work areas that were open before the

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Richard Kaye
during SQL SELECT Execution procedure closeforsql lparameters thealias if type(alias(thealias))#T_U use in (thealias) endif return endproc This is kind of similar to what my query class does to clean up after itself. However, my class keeps track of tables/work areas

Re: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
If you want to be CERTAIN that you are getting a new data file on disk/in memory disconnected from the original source, you can: (1) change the structure by adding a field not in the original source, even a .t. as dummyfield, to the field list. (2) use READWRITE or NOFILTER, depending on your

RE: File In Use on USE during SQL SELECT Execution

2015-07-17 Thread Ken Dibble
He's really parameter checking with that TYPE test, not checking that the alias is USED. Exactly. But if the alias is not USED(), then he assumes its TYPE() will be U so he doesn't have to close it. And I believe it works without having to address work areas, at least within the current

RE: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ken Dibble
Have you ruled out an external program locking the DBF/CDX/FPT file to do some type of check. Meaning, is there anti-virus, or on-demand back up tools running and keeping an eye on that network path? Has someone setup a local anti-virus tool to check network drives? (very bad setting, most

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ken Dibble
RTF? How... quaint. How ... (still, for the time-being) universally readable and non-proprietary. :) Ken ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ted Roche
to avoid the error and give you some more time to track down the source. If I understand correctly, the big picture logic is that the user tried to search for a person, executing a SQL SELECT statement via macro, something went wrong, the app shuts down (you claim the user has to have hit the 'X

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Man-wai Chang
On Mon, Jul 13, 2015 at 11:27 PM, Ken Dibble krdib...@stny.rr.com wrote: Question 1: Does a SQL SELECT place a lock on a VFP .dbf table such that the same user can't issue a USE on the table while the query is running? It will open a table in shared mode. It seemed that a table or an alias

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ken Dibble
A quick-and-dirty solution is to check USED(_table_name_) before issuing any USE _table_name_! Here is an example: Thank you. I always do that. In fact, my framework has a data manager class that handles this, so USE and SELECT are only issued in one place. If USED() is .T., then I SELECT

RE: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Richard Kaye
] On Behalf Of Ken Dibble Sent: Thursday, July 16, 2015 9:21 AM To: profoxt...@leafe.com Subject: Re: File In Use on USE during SQL SELECT Execution A quick-and-dirty solution is to check USED(_table_name_) before issuing any USE _table_name_! Here is an example: Thank you. I always do that. In fact, my

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ted Roche
On Thu, Jul 16, 2015 at 9:21 AM, Ken Dibble krdib...@stny.rr.com wrote: However, I have also seen this before, rarely, in other situations: IF NOT USED(mytable) USE mytable IN 0 Error 3; File in use. ENDIF USED() only tells you if an ALIAS name is used, not a table. create table

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ted Roche
RTF? How... quaint. On Thu, Jul 16, 2015 at 12:40 PM, Ken Dibble krdib...@stny.rr.com wrote: I'm about to post a very long message providing excruciating detail about this. Which, apparently, is hung up in the spam filter. *sigh* If anyone would like to read it, it's at:

RE: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Tracy Pearson
Ken Dibble wrote on 2015-07-16: I'm about to post a very long message providing excruciating detail about this. Which, apparently, is hung up in the spam filter. *sigh* If anyone would like to read it, it's at: www.stic-cil.org/CILData/Error 3.rtf Thanks. Ken Ken,

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ken Dibble
I'm about to post a very long message providing excruciating detail about this. Which, apparently, is hung up in the spam filter. *sigh* If anyone would like to read it, it's at: www.stic-cil.org/CILData/Error 3.rtf Thanks. Ken ___ Post

RE: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ken Dibble
USE mytable IN SELECT([mytable]) If it's not USED the SELECT() function returns the equivalent of the next available workarea. If the assumption is that you just want that table open, this eliminates any amibiguity. Of course as you've pointed out, if another user or process has an

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ken Dibble
USED() only tells you if an ALIAS name is used, not a table. create table temp (field1 c(10), field2 d) USE use temp alias nottemp in 0 ? used(temp) .F. Yup. But my code never sets up ALIASes that are different from the table name. I'm about to post a very long message providing

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ken Dibble
, executing a SQL SELECT statement via macro, something went wrong, the app shuts down (you claim the user has to have hit the 'X' to close the window?), the app checks to see if all users are logged off and if so, goes into a backup and maintenance routine in which the File is in use error trips. Did I get

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Ted Roche
On Thu, Jul 16, 2015 at 3:09 PM, Ken Dibble krdib...@stny.rr.com wrote: Is there some other quick test I should use? I did put in a request years ago for MS to add a BROWSE FOR CORRUPTED() but MS thought it would be too hard. A real problem with a bit set in the wrong place is that you won't

Re: File In Use on USE during SQL SELECT Execution

2015-07-16 Thread Charlie
On 7/16/2015 9:21 AM, Ken Dibble wrote: A quick-and-dirty solution is to check USED(_table_name_) before issuing any USE _table_name_! Here is an example: Thank you. I always do that. In fact, my framework has a data manager class that handles this, so USE and SELECT are only issued in one

Re: File In Use on USE during SQL SELECT Execution

2015-07-15 Thread Laurie Alvey
As far as I know, SQL SELECT uses its own data session, so it shouldn't interfere with other users. Laurie On 13 July 2015 at 16:27, Ken Dibble krdib...@stny.rr.com wrote: My error handler has recently reported two instances of the following scenario: User causes a SQL SELECT query to run

Re: File In Use on USE during SQL SELECT Execution

2015-07-15 Thread Ken Dibble
As far as I know, SQL SELECT uses its own data session, so it shouldn't interfere with other users. Thank you Laurie. Unfortunately, that was the one rational explanation I could think of for this behavior. I know that modality in VFP is sometimes... er... unreliable, but only one

Re: File In Use on USE during SQL SELECT Execution

2015-07-15 Thread Ken Dibble
In one of these cases, the user starts the query in a modal child window, and therefore should not be able to click the x close button or the upper-left-corner popup-menu button to trigger QueryUnload(). So that's another headache. I was able to talk to the user involved in this one. He

Re: File In Use on USE during SQL SELECT Execution

2015-07-15 Thread Ken Dibble
At 10:08 AM 7/15/2015 -0400, you wrote: In one of these cases, the user starts the query in a modal child window, and therefore should not be able to click the x close button or the upper-left-corner popup-menu button to trigger QueryUnload(). So that's another headache. I was able to

File In Use on USE during SQL SELECT Execution

2015-07-13 Thread Ken Dibble
My error handler has recently reported two instances of the following scenario: User causes a SQL SELECT query to run. Suddenly, the application is being shut down via my custom main window's QueryUnload(). Normal shutdown requires access to tables that may be implicated in the SQL SELECT

Re: record list in sql select

2014-11-20 Thread Rafael Copquin
Recno() is not good, because depending on the filter you get numbers with holes, like 1,2,35.56,etc. I need a sequential numbering, from 1 to rowcount Rafael Copquin El 19/11/2014 18:41, Stephen Russell escribió: On Wed, Nov 19, 2014 at 1:02 PM, Rafael Copquin rcopq...@fibertel.com.ar wrote:

Re: record list in sql select

2014-11-20 Thread Ted Roche
Is this true? Have you tested it? With a cursor readwrite, you're forcing an unfiltered cursor view, so the recno() should be sequential. On Thu, Nov 20, 2014 at 12:34 PM, Rafael Copquin rcopq...@fibertel.com.ar wrote: Recno() is not good, because depending on the filter you get numbers with

Re: record list in sql select

2014-11-20 Thread AndyHC
CREATE CURSOR cc (rec i autoinc, fld C(20) ) INSERT INTO cc (fld) SELECT fld FROM bigfile where code = 'yes' On 20/11/2014 23:04, Rafael Copquin wrote: Recno() is not good, because depending on the filter you get numbers with holes, like 1,2,35.56,etc. I need a sequential numbering, from 1 to

Re: record list in sql select

2014-11-20 Thread Rafael Copquin
I tried the solutions suggested here, (yours Ted and others) Instantaneous means less than one second. This is for showing, at the end of each record, the record number as a page number like this: page 245 of 1234987 As the user navigates the table up or down, top or bottom, the page number

Re: record list in sql select

2014-11-20 Thread Rafael Copquin
Awsome! I did not know you could insert directly from a select statement I learned something fabulous today Thank you very much indeed! Rafael Copquin El 20/11/2014 14:51, AndyHC escribió: CREATE CURSOR cc (rec i autoinc, fld C(20) ) INSERT INTO cc (fld) SELECT fld FROM bigfile where code

Re: record list in sql select

2014-11-20 Thread Rafael Copquin
you are right, I had not tested it. It works Rafael El 20/11/2014 14:47, Ted Roche escribió: Is this true? Have you tested it? With a cursor readwrite, you're forcing an unfiltered cursor view, so the recno() should be sequential. ___ Post

Re: record list in sql select

2014-11-20 Thread Gene Wirchenko
At 14:10 2014-11-19, Ted Roche tedro...@gmail.com wrote: On Wed, Nov 19, 2014 at 4:37 PM, Gene Wirchenko ge...@telus.net wrote: At 11:20 2014-11-19, Ted Roche tedro...@gmail.com wrote: FoxPro is faster than you think. REPLACE ALL (placeholderfield) WITH RECNO() is practically

Re: record list in sql select

2014-11-20 Thread Stephen Russell
On Thu, Nov 20, 2014 at 11:37 AM, Gene Wirchenko ge...@telus.net wrote: CREATE CURSOR fred (myresult c(10), therecno I) FOR I = 1 TO 11 INSERT INTO fred values( data, 0) NEXT REPLACE ALL therecno WITH RECNO() IN fred Subsecond result, on an old Core2 processor with 4 Gb RAM.

record list in sql select

2014-11-19 Thread Rafael Copquin
I am pulling a set of records from a big table, based on a filter condition in the select statement. I also want to create a field with the sequential number of those records. Example: select *, (function to number records) as recnbr from bigtable where filtercondition into cursor curFiltered

Re: record list in sql select

2014-11-19 Thread Ted Roche
FoxPro is faster than you think. REPLACE ALL (placeholderfield) WITH RECNO() is practically instantaneous, for reasonable values of instant. On Wed, Nov 19, 2014 at 2:02 PM, Rafael Copquin rcopq...@fibertel.com.ar wrote: I am pulling a set of records from a big table, based on a filter

Re: record list in sql select

2014-11-19 Thread Gene Wirchenko
At 11:20 2014-11-19, Ted Roche tedro...@gmail.com wrote: FoxPro is faster than you think. REPLACE ALL (placeholderfield) WITH RECNO() is practically instantaneous, for reasonable values of instant. Maybe not. I did something similar just now on a table of about 110,000 rows, and

Re: record list in sql select

2014-11-19 Thread Stephen Russell
On Wed, Nov 19, 2014 at 1:02 PM, Rafael Copquin rcopq...@fibertel.com.ar wrote: I am pulling a set of records from a big table, based on a filter condition in the select statement. I also want to create a field with the sequential number of those records. Example: select *, (function to

Re: record list in sql select

2014-11-19 Thread Ted Roche
On Wed, Nov 19, 2014 at 4:37 PM, Gene Wirchenko ge...@telus.net wrote: At 11:20 2014-11-19, Ted Roche tedro...@gmail.com wrote: FoxPro is faster than you think. REPLACE ALL (placeholderfield) WITH RECNO() is practically instantaneous, for reasonable values of instant. Maybe not.

Re: SQL select

2014-11-11 Thread Gérard Lochon
I didn't know that we could have a 'group by' clause without any 'agregation field' (SUM(), AVG(), ...). It's why I built a '2 stages' query ... Aggregation is not needed when the only fields mentioned in the group by clause are the same that the selected ones. Gérard.

Re: SQL select

2014-11-11 Thread Stephen Russell
On Mon, Nov 10, 2014 at 4:33 PM, Sytze de Boer sytze.k...@gmail.com wrote: Friends, can you help me I have a table with approx 50,000 records About a 1000 have a common link code I want to display only those items that have a common link code There's 2 dozen fields, and a field called

Re: SQL select

2014-11-11 Thread Koen Piller
Hi, Try with this code: CREATE CURSOR fsupdate (usdot Int) INSERT INTO fsupdate VALUES (1) INSERT INTO fsupdate VALUES (2) INSERT INTO fsupdate VALUES (3) INSERT INTO fsupdate VALUES (1) INSERT INTO fsupdate VALUES (1) INSERT INTO fsupdate VALUES (4) INSERT INTO fsupdate VALUES (5) INSERT INTO

SQL select

2014-11-10 Thread Sytze de Boer
Friends, can you help me I have a table with approx 50,000 records About a 1000 have a common link code I want to display only those items that have a common link code There's 2 dozen fields, and a field called linkcode SELECT *,COUNT(*) as grp FROM rotables GROUP BY linkcode INTO TABLE

Re: SQL select

2014-11-10 Thread Richard Quilhot
Use the set enginebehavior to 70 Rick Q quilh...@gmail.com On Mon, Nov 10, 2014 at 5:33 PM, Sytze de Boer sytze.k...@gmail.com wrote: Friends, can you help me I have a table with approx 50,000 records About a 1000 have a common link code I want to display only those items that have a

Re: SQL select

2014-11-10 Thread Jean MAURICE
Hi Sytze, you should buy Tamar Granor's book about SQL ... Your query could be something like SELECT * FROM rotables ; WHERE linkcode IN ; (SELECT linkcode FROM (SELECT linkcode, COUNT(*) AS nb FROM rotables ; GROUP BY 1 HAVING COUNT(*)1) ; ) ; ORDER BY linkcode INTO

Re: SQL select

2014-11-10 Thread Michael Glassman
You want HAVING grp 1 rather than WHERE grp 1. Put it between the GROUP BY and INTO clauses. Mike ___ From: Sytze de Boer Sent: Monday, November 10, 2014 3:33 PM To: profoxt...@leafe.com Subject: SQL select Friends, can you help me I have

  1   2   3   >