Re: [SQL] reinitialize a sequence?

2000-12-05 Thread Ross J. Reedstrom
Following up to myself: There is in fact a bug in 7.0.2 that's been fixed in 7.0.3 which causes my select below not to work. The name of the sequence is now stored with double quotes around it, to handle the mixed case names problem, so the query needs to look like (untested: note added double qu

Using SELECT as DDL/DML statement is wrong (was RE: [SQL] reinitialize a sequence?)

2000-12-05 Thread Edmar Wiggers
If and when stored procedures are supported, there should be some way to prevent functions called in a SELECT statement to modify the database (create, insert, etc.). It is confusing (and wrong IMHO) to use statements like SELECT setval('tablename_serfield_seq',max(serfield)) FROM tablename; (wh

Re: [SQL] reinitialize a sequence?

2000-12-05 Thread Ross J. Reedstrom
On Mon, Dec 04, 2000 at 03:51:35PM -0800, Dan Lyke wrote: > Bruno Boettcher writes: > > is there a simple way to tell all sequences to take the max value +1 of > > their respective tables? (a bit like the vacuum command?) > > This is completely gross, but what I've done: > Hmm, what I usually d

[SQL] Join performance

2000-12-05 Thread Koen Antonissen
Hi there, I'm having some problems with the performance on queries including a join. for example: SELECT members_data.pwd FROM emails,members_data WHERE emails.email = '[EMAIL PROTECTED]' AND emails.uin = members_data.uin; is a lot slower then extracting the join into 2 seperate queries like: