Re: [SQL] Update and trigger

2008-06-10 Thread Craig Ringer
Medi Montaseri wrote: Hi, I need to increament a counter such as myTable.Counter of type integer everytime myTable.status a boolean column is updated. Can you help me complete this... create trigger counter_trigger after update on myTable.counter execute procedure 'BEGIN statement; statement

Re: [SQL] Update and trigger

2008-06-10 Thread A. Kretschmer
am Tue, dem 10.06.2008, um 18:45:51 -0700 mailte Medi Montaseri folgendes: > Hi, > > I need to increament a counter such as myTable.Counter of type integer > everytime myTable.status a boolean column is updated. Can you help me complete > this... > > create trigger counter_trigger after update o

[SQL] Update and trigger

2008-06-10 Thread Medi Montaseri
Hi, I need to increament a counter such as myTable.Counter of type integer everytime myTable.status a boolean column is updated. Can you help me complete this... create trigger counter_trigger after update on myTable.counter execute procedure 'BEGIN statement; statement; statement END' Q1- how d

Re: [SQL] Conceptual Design Question

2008-06-10 Thread Medi Montaseri
Assuming common semantics for a given field then the question of breaking it to many parts is also a function of its size as related to I/O. We know that memory allocation and I/O read/writes are not granular to bytes and are rather blocks of bytes as it travels from VM (virtual memory) all the wa

Re: [SQL] help in writing query

2008-06-10 Thread maria s
Hi Scott, Thanks for the information. This is very useful for me. I will be careful when forming the column. Thanks, -maria On Tue, Jun 10, 2008 at 3:16 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Tue, Jun 10, 2008 at 11:51 AM, maria s <[EMAIL PROTECTED]> wrote: > > Hi Rosario, > > Thanks

Re: [SQL] help in writing query

2008-06-10 Thread Scott Marlowe
On Tue, Jun 10, 2008 at 11:51 AM, maria s <[EMAIL PROTECTED]> wrote: > Hi Rosario, > Thanks for the link. I hope this will solve my problem. It should be able to. Note that crosstab functions expect "square" inputs from the select they run. I.e. you can't have empty columns, you need to replace

Re: [SQL] Conceptual Design Question

2008-06-10 Thread Steve Midgley
At 10:52 AM 6/10/2008, [EMAIL PROTECTED] wrote: Date: Tue, 10 Jun 2008 05:05:24 -0700 From: Bryan Emrys <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Subject: Conceptual Design Question Message-ID: <[EMAIL PROTECTED]> Hello Everyone, In a text-heavy database, I'm trying to make an initial de

Re: [SQL] help in writing query

2008-06-10 Thread maria s
Hi Rosario, Thanks for the link. I hope this will solve my problem. Thanks, Maria On Tue, Jun 10, 2008 at 11:34 AM, Osvaldo Rosario Kussama < [EMAIL PROTECTED]> wrote: > maria s escreveu: > >> >> I tried the query and it is returning result as , >> for a single entry in sample info in separate r

Re: [SQL] help in writing query

2008-06-10 Thread Pavel Stehule
2008/6/10 maria s <[EMAIL PROTECTED]>: > Hi Pavel, > Thank you for your reply. > > I tried the query and it is returning result as , > for a single entry in sample info in separate rows > > The result of the query as > > 1, prop1,value1 > 1,prop2,value2 > 2,prop1,value1 > 2 prop2,value2 > 2 prop3,v

Re: [SQL] help in writing query

2008-06-10 Thread Osvaldo Rosario Kussama
maria s escreveu: I tried the query and it is returning result as , for a single entry in sample info in separate rows The result of the query as 1, prop1,value1 1,prop2,value2 2,prop1,value1 2 prop2,value2 2 prop3,value3 but i want the output as single row per sample id like 1,value1,value2

Re: [SQL] Trouble with exception

2008-06-10 Thread samantha mahindrakar
Thanks Craig that reply really helped. I had used second approach where i converted the INSERT into a loop with an exception block.but as you said it does take a lot of time. So i changed the INSERt query itself to exclude the records that were causing the problem. It sad that the query is

Re: [SQL] help in writing query

2008-06-10 Thread maria s
Hi Pavel, Thank you for your reply. I tried the query and it is returning result as , for a single entry in sample info in separate rows The result of the query as 1, prop1,value1 1,prop2,value2 2,prop1,value1 2 prop2,value2 2 prop3,value3 but i want the output as single row per sample id like

Re: [SQL] One Text Table or Multiple Text Tables - Design Tradeoffs?

2008-06-10 Thread Chris Browne
[EMAIL PROTECTED] (Bryan Emrys) writes: > (Trying to start a new thread instead of my accidental intrusion into another > thread) > > Hello Everyone, > > In a text-heavy database, I'm trying to make an initial design decision in > the following context. > > There is a lot of long text that I co

Re: [SQL] Nextval & Currval

2008-06-10 Thread Scott Marlowe
On Tue, Jun 10, 2008 at 7:14 AM, Shavonne Marietta Wijesinghe <[EMAIL PROTECTED]> wrote: > I managed to make the connection work. I tried inserting records from 2 > computers. It works fine untill 2 computers insert a nextwall one after > another. > > Here is a small example of what i see in my DB

Re: [SQL] help in writing query

2008-06-10 Thread Pavel Stehule
Hello SELECT i.name, p.property_name, p.property_value FROM sample_info i JOIN sample_properties p ON i.id = p.id maybe Pavel 2008/6/10 maria s <[EMAIL PROTECTED]>: > Hello friends, > I need help in write a query. > > I have 2 tables, one is sample_info

Re: [SQL] Nextval & Currval

2008-06-10 Thread Shavonne Marietta Wijesinghe
I managed to make the connection work. I tried inserting records from 2 computers. It works fine untill 2 computers insert a nextwall one after another. Here is a small example of what i see in my DB ++|+|++ N °| Session| Number +

[SQL] One Text Table or Multiple Text Tables - Design Tradeoffs?

2008-06-10 Thread Bryan Emrys
(Trying to start a new thread instead of my accidental intrusion into another thread) Hello Everyone, In a text-heavy database, I'm trying to make an initial design decision in the following context. There is a lot of long text that I could break down into three different categories:

[SQL] Apologies to the list. Please ignore accidental thread intrusion

2008-06-10 Thread Bryan Emrys
Sorry about that. Bryan -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Conceptual Design Question

2008-06-10 Thread Bryan Emrys
Hello Everyone, In a text-heavy database, I'm trying to make an initial design decision in the following context. There is a lot of long text that I could break down into three different categories: a. Laws i. Only 1 country per law, many laws ii. Ther

Re: [SQL] returning results from an update for joining other tables

2008-06-10 Thread Patrick Scharrenberg
Hi! >> >> What I tried was something like this, which gave me a syntax error: >> >> >> >> SELECT * FROM >> >> ( UPDATE ta >> >> SET process_node='nodename' >> >> WHERE a>10 AND process_node is null >> >> RETURNING * >> >> ) AS ta >> >> JOIN someothertable ON ... > > > > It's a know limitation

Re: [SQL] Nextval & Currval

2008-06-10 Thread Shavonne Marietta Wijesinghe
This is the test i did for the connection. ' Connecting to the database WriteToFile logfilepath, date & " " & time & "isobject(conn) = " & isobject(session("connection")) & vbcrlf , True if not isobject(session("connection")) then Set conn = Server.CreateObject("ADODB.Connection") conn.Op

Re: [SQL] Nextval & Currval

2008-06-10 Thread A. Kretschmer
am Tue, dem 10.06.2008, um 11:56:39 +0200 mailte Shavonne Marietta Wijesinghe folgendes: > Hello > > I'm using Nextval and Currval in my ASP programme. But everytime i run the > code > only the nextval record is inserted and the currval record is lost. I wrote > the > INSERT INTO in the log a

[SQL] Nextval & Currval

2008-06-10 Thread Shavonne Marietta Wijesinghe
Hello I'm using Nextval and Currval in my ASP programme. But everytime i run the code only the nextval record is inserted and the currval record is lost. I wrote the INSERT INTO in the log and when i tried it via pgadmin both the records were inserted correctly, so there is no syntax error. I

Re: [SQL] returning results from an update for joining other tables

2008-06-10 Thread Patrick Scharrenberg
Hi! >> What I tried was something like this, which gave me a syntax error: >> >> SELECT * FROM >> ( UPDATE ta >> SET process_node='nodename' >> WHERE a>10 AND process_node is null >> RETURNING * >> ) AS ta >> JOIN someothertable ON ... > > It's a know limitation, see <[EMAIL PROTECTE

Re: [SQL] returning results from an update for joining other tables

2008-06-10 Thread A. Kretschmer
am Tue, dem 10.06.2008, um 10:50:52 +0200 mailte Patrick Scharrenberg folgendes: > Hi! > > I have a table containing data and a column which holds information on > which compute-node processes the data. In a given interval I'd like to > request some data from this table and mark these returned r

[SQL] returning results from an update for joining other tables

2008-06-10 Thread Patrick Scharrenberg
Hi! I have a table containing data and a column which holds information on which compute-node processes the data. In a given interval I'd like to request some data from this table and mark these returned rows by setting the "process_node" column to the node-name, which asked for data. There may al