[SQL] Ask To Optimize Looping

2009-08-19 Thread Otniel Michael
Hi guys, can anyone help to optimize this loop : for i in select kodedivisi,kodeseksi,kodewip,nobatch,ket1,ket2,ket3,ket4,NILAIPROP as nilaiygdibagi from EDP040_07_23 order by kodedivisi,kodeseksi,kodewip,nobatch,ket1,ket2,ket3,ket4 loop jmlData2 =

[SQL] Ask About SQL

2009-08-19 Thread Otniel Michael
Hi All. Can help to create sql queries for this data : tabel A field1, field2, field3 x1, y1, 5 x1, y2, 1 x2, y1, 2 x2, y3, 4 x1, y3, 4 I want to get 2 record with the max value at field3 for each kombination of field1 : tabel B field1, field2, field3

Re: [SQL] Ask About SQL

2009-08-19 Thread A. Kretschmer
In response to Otniel Michael : Hi All. Can help to create sql queries for this data : tabel A field1, field2, field3 x1, y1, 5 x1, y2, 1 x2, y1, 2 x2, y3, 4 x1, y3, 4 I want to get 2 record with the max value at field3 for each kombination

Re: [SQL] Ask About SQL

2009-08-19 Thread Joshua Tolley
On Wed, Aug 19, 2009 at 05:17:07PM +0700, Otniel Michael wrote: Hi All. Can help to create sql queries for this data : tabel A field1, field2, field3 x1, y1, 5 x1, y2, 1 x2, y1, 2 x2, y3, 4 x1, y3, 4 I want to

Re: [SQL] Ask To Optimize Looping

2009-08-19 Thread Marc Mamin
Hello, I would try to replace the loop with a single UPDATE FROM Statement: Update EP_ES06_N_TEMP2 Set FROM ( select kodedivisi,kodeseksi,kodewip,nobatch,ket1,ket2,ket3,ket4,NILAIPROP as nilaiygdibagi from EDP040_07_23 --order by

Re: [SQL] [PERFORM] SQL Query Performance - what gives?

2009-08-19 Thread Pierre Frédéric Caillau d
The bitmask allows the setting of multiple permissions but the table definition doesn't have to change (well, so long as the bits fit into a word!) Finally, this is a message forum - the actual code itself is template-driven and the bitmask permission structure is ALL OVER the templates;

Re: [SQL] Multiple simultaneous queries on single connection

2009-08-19 Thread Yeb Havinga
Hello Craig, list Is there a way to have two or more connections see each others uncommitted things? Not at present. You should be able to use explicitly declared cursors and FETCH to interleave requests for results from one or more queries in the same transation using the one connection,

[SQL] Call Procedure From Trigger Function

2009-08-19 Thread Doug Pisarek
I am in the process of coverting an Oracle 10.2.0.3 database to Postgresql 8.3. I have a number of triggers in Oracle that make a call to packages. I know I will need to re-write the Oracle packages to postgres functions. The issue which I have can I make a procedure call from inside a postgres

Re: [SQL] Call Procedure From Trigger Function

2009-08-19 Thread Scott Marlowe
On Wed, Aug 19, 2009 at 3:53 PM, Doug Pisarekd...@strata-group.com wrote: I am in the process of coverting an Oracle 10.2.0.3 database to Postgresql 8.3. I have a number of triggers in Oracle that make a call to packages. I know I will need to re-write the Oracle packages to postgres functions.

Re: [SQL] Call Procedure From Trigger Function

2009-08-19 Thread ramasubramanian
Yes you can make a procedure call in a trigger function. Example Trigger block { PERFORM Procedure(); } Regards. Ram - Original Message - From: Scott Marlowe scott.marl...@gmail.com To: Doug Pisarek d...@strata-group.com Cc: pgsql-sql@postgresql.org Sent: Thursday, August 20,