Re: [SQL] three-way join - solved

2004-04-20 Thread Stijn Vanroye
First off, I'm sorry I couldn't get you a reply sooner. I see you have found another way, which is good :-) > I've sorted it. > > Firstly, I've done away with the status field. If an item's > been issued or is > still on order it does not have a location. I've therefore > set up two > loc

Re: [SQL] [JDBC] Prepared Statements and large where-id-in constant blocks?

2004-04-20 Thread Oliver Jowett
Oliver Jowett wrote: The CMP layer could perhaps use the = ANY array syntax and setArray() (note that setArray() in the current driver needs fixing, I have an old patch to do this): SELECT t1.attr1 FROM t1 where t1.id = ANY (?) Unfortunately a bit of experimentation indicates that the planner

[SQL] Can someone tell me why this statement is failing?

2004-04-20 Thread P A
Can anyone tell me why this SQL statement is not matching with the row from the table below? I think I'm going mad! # SQL Statement # SELECT * FROM t_bell_schedule WHERE calendar_day = '2004-04-12' AND start_time_minutes >= '

Re: [SQL] [JDBC] Prepared Statements and large where-id-in constant blocks?

2004-04-20 Thread Oliver Jowett
James Robinson wrote: Howdy: Java middlewares like JBossCMP issue many queries in the general form of: SELECT t1.att1, t1.att2 ... t1.attN FROM t1 WHERE (t1.id = X) or (t1.id = Y) where there may be anywhere between 1 and thousands of "(id = N)" blocks ORed together. 2)

Re: [SQL] Can someone tell me why this statement is failing?

2004-04-20 Thread Martin Marques
El Lun 19 Abr 2004 17:31, P A escribió: > Can anyone tell me why this SQL statement is not > matching with the row from the table below? I think > I'm going mad! > > # > SQL Statement > # > > SELECT * FROM t_bell_schedule WHERE

Re: [SQL] Can someone tell me why this statement is failing?

2004-04-20 Thread Edmund Bacon
Your end time minutes is NULL, comparing NULL to anything (even NULL itself) yields NULL so you either need to: SELECT * FROM ... WHERE ... AND (end_time_minutes IS NULL OR end_time_minutes <= '1082375100'); or SELECT * FROM ... WHERE ... AND coalsece(end_time_minutes, 0) <= '1082375100'; P

Re: [SQL] [JDBC] Prepared Statements and large where-id-in constant blocks?

2004-04-20 Thread James Robinson
On Apr 19, 2004, at 10:57 PM, Oliver Jowett wrote: Unfortunately a bit of experimentation indicates that the planner doesn't do anything clever with ANY + constant array values (at least in 7.4.1 which is what I have to hand): Not only that, but it seems to get planned only as an index scan. Pr

Re: [SQL] Can someone tell me why this statement is failing?

2004-04-20 Thread Rod Taylor
> Can anyone tell me why this SQL statement is not > matching with the row from the table below? I think > I'm going mad! Indeed. The row is NOT in that range. 1082377320 is > 1082375100 not <= it ---(end of broadcast)--- TIP 3: if posting/reading

[SQL] Syntax for cmd to EXEC...how many quotes?

2004-04-20 Thread David B
Folks, This is driving me crazy...I'm sure it's possible but that I am getting the #quotes wrong in some way... I keep getting unterminated string errors...now matter how many quotes I use. I have a FN that I want to loop through all views and populate a table with a count(*) from each views. To

[SQL] transaction

2004-04-20 Thread H.J. Sanders
Hello list. We are migrating from Informix to PSQL. In Informix we used to do: - BEGIN WORK - INSERT ROW - IF FAILED THEN UPDATE ROW - COMMIT WORK In PSQL this does not seem to work because after the first error (the insert) everything is omitted. Has someone found a solution for this (w

[SQL] Follow-up: FK constraint performance

2004-04-20 Thread ow
Hi, This issue appears to be present in 7.4.2 Am not sure if the plan was to fix it or leave like this. Any ideas? Thanks See http://archives.postgresql.org/pgsql-sql/2004-02/msg00104.php or http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=20040212140516.65859.qmail%40web60807.mail.y

Re: [SQL] transaction

2004-04-20 Thread Bruno Wolff III
On Tue, Apr 20, 2004 at 21:14:48 +0200, "H.J. Sanders" <[EMAIL PROTECTED]> wrote: > > Hello list. > > We are migrating from Informix to PSQL. > > In Informix we used to do: > > - BEGIN WORK > > - INSERT ROW > > - IF FAILED THEN UPDATE ROW > > - COMMIT WORK > > > In PSQL this does not se

[SQL] staggered query?

2004-04-20 Thread Vincent Ladlad
hi! im new to SQL, and i need to find a solution to this problem: i have a table with two columns, the first column is of type timestamp. the table contains hundreds of thousands of records. i need to get all the entries/records at every 10 seconds interval. example, given a table: hh/mm/ss |

Re: [SQL] Follow-up: FK constraint performance

2004-04-20 Thread ow
> > Hi, > > This issue appears to be present in 7.4.2 Am not sure if the plan was to fix > it or leave like this. Any ideas? Thanks > > See http://archives.postgresql.org/pgsql-sql/2004-02/msg00104.php Never mind. I think it works. Thanks