Re: [SQL] Selecting a non-locked row.

2003-01-19 Thread D'Arcy J.M. Cain
On Sunday 19 January 2003 16:26, Josh Berkus wrote: > > I was thinking about using a select for update limit 1, but > > the other persons will of course try to select the same record > > and wait until that one is released. The locks are held for a > > long period of time. > > > > Is there a

Re: [SQL] Group By Error Text

2003-01-19 Thread Josh Berkus
Joe, > ERROR: Attribute drawing_register.jobno must be GROUPed or used in an > aggregate function > > Is this correct? Getting rid of the error is easy: > > select jobno, count(jobno) from drawing_register group by jobno; > > I believe that jobno is being used in an aggregate function. Should

[SQL] Group By Error Text

2003-01-19 Thread Joseph Healy
Hi with the following query: select jobno, count(jobno) from drawing_register; I get the following error: ERROR: Attribute drawing_register.jobno must be GROUPed or used in an aggregate function Is this correct? Getting rid of the error is easy: select jobno, count(jobno) from drawing_regist

Re: [SQL] Selecting a non-locked row.

2003-01-19 Thread Josh Berkus
Kurt, > Of course a second person doing the same thing will just wait for > my commit. > > What I want is that he just gets the next non-locked record. Well, there's two ways you can do this: 1) hack the system tables to find out which incomplete rows in the table are currently locked, and se

Re: [SQL] Selecting a non-locked row.

2003-01-19 Thread Kurt Roeckx
On Sun, Jan 19, 2003 at 01:26:10PM -0800, Josh Berkus wrote: > Kurt, > > > I have a table with records in, and they either still need to be > > processed or not. Several people will be using the table at the > > same time. > > > > I was thinking about using a select for update limit 1, but

Re: [SQL] Selecting a non-locked row.

2003-01-19 Thread Josh Berkus
Kurt, > I'm in the process of writing an application, and I'm not sure > how to properly solve it. > > I have a table with records in, and they either still need to be > processed or not. Several people will be using the table at the > same time. > > I was thinking about using a select for

[SQL] Selecting a non-locked row.

2003-01-19 Thread Kurt Roeckx
I'm in the process of writing an application, and I'm not sure how to properly solve it. I have a table with records in, and they either still need to be processed or not. Several people will be using the table at the same time. I was thinking about using a select for update limit 1, but th