[SQL] Multiple SRF parameters from query

2005-05-31 Thread Federico Pedemonte
Hi All,

i'm having troubles trying to write a sql query using a Set Returning
Function.

I have a function foo (ID varchar) that returns a variable number of
records.
I have also a table (called Anagrafica) that contains a list of IDs to
be passed to the function foo.

As an example, just say that Anagrafica is like this:

Anagrafica

ID  | n
+---
aaa | 1
bbb | 5
ccc | 9
ddd | 10
eee | 11

and foo returns this values 

select * from foo ('aaa')

a | b | c
--+---+---
1 | 2 | 3
5 | 9 | 1


select * from foo ('bbb')

a | b | c
--+---+---
4 | 0 | 0 
2 | 0 | 0
0 | 0 | 0 


what i would like to do is write an SQL query that looks something like
this (written in simplyfied-pseudo-sql)

SELECT FROM anagrafica
  WHERE n < 5 
SELECT * FROM Foo (anagrafica.ID)   
  
and that gives as result a table that is the union of foo ('aaa') and
foo ('bbb')

a | b | c
--+---+---
1 | 2 | 3
5 | 9 | 1
4 | 0 | 0 
2 | 0 | 0
0 | 0 | 0 

I'm having success if foo returns only a row, but the problem is that
foo returns more than one.
I think i sould use a join but i couldn't find the right syntax for it.

I don't want to create a spefic PL/pgSQL function becase i need to have
freedom in selecting IDs from Anagrafica (the one i provided is just an
example, the real table is much more complex).

I would really appreciate any suggestion.

Best regards, 
Federico.


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [SQL] (Mis)using the PostgreSQL planner to get estimated row counts

2005-05-31 Thread Tom Lane
Nick Johnson <[EMAIL PROTECTED]> writes:
> I'm trying to write a PostgreSQL extension to estimate the number of  
> rows returned by a SELECT statement.

Instead of fooling around at the C level, why don't you just do an
EXPLAIN and parse out the first row of the result?  For instance

regression=# create function estimate_row_count(text) returns text as $$
regression$# declare x record;
regression$# begin
regression$#   for x in execute 'EXPLAIN ' || $1 loop
regression$# return substring(x."QUERY PLAN" from 'rows=([0-9]+) width=');
regression$#   end loop;
regression$# end$$ language plpgsql strict;
CREATE FUNCTION
regression=# select estimate_row_count('select * from tenk1');
 estimate_row_count

 1
(1 row)

Of course this is subject to future breakage due to changes in the
output textual format, etc etc, but it's surely less fragile than
anything written in C will be.

Depending on what you want the results for, it might be best to ignore
any top-level LIMIT node.

regards, tom lane

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[SQL] Sum() rows

2005-05-31 Thread lucas
Hi.
How can I sum a row and show the sum for each row???
For example, in a finances table that have the total movimentation(debit/credit)
in the bank.

i.e:
CREATE TABLE TB1 (id integer primary key, value numeric);
insert into tb1 values (1,20);
insert into tb1 values (2,2);
insert into tb1 values (3,3);
insert into tb1 values (4,17);
insert into tb1 values (5,-0.5);
insert into tb1 values (6,3);

I want a query that returns:
-id- | --- value --- | --- subtot ---
   1 |20.00  | 20.00
   2 | 2.00  | 22.00
   3 | 3.00  | 25.00
   4 |17.00  | 42.00
   5 |-0.50  | 41.50
   6 | 3.00  | 44.50

The subtot colum will be the "prev. subtot colum"+"value colum". :-/
I dont know how to make the "subtot" colum, I tried to use the sum() function
but it not works correctly.
Any idea???

Thanks.

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [SQL] Sum() rows

2005-05-31 Thread Bruno Wolff III
On Tue, May 31, 2005 at 13:36:48 -0300,
  [EMAIL PROTECTED] wrote:
> Hi.
> How can I sum a row and show the sum for each row???

Since in your example the id field gives the ordering, you can use a subselect
to add up the subtotal for rows with and id less than or equal to the value
of id for the current row.

> For example, in a finances table that have the total 
> movimentation(debit/credit)
> in the bank.
> 
> i.e:
> CREATE TABLE TB1 (id integer primary key, value numeric);
> insert into tb1 values (1,20);
> insert into tb1 values (2,2);
> insert into tb1 values (3,3);
> insert into tb1 values (4,17);
> insert into tb1 values (5,-0.5);
> insert into tb1 values (6,3);
> 
> I want a query that returns:
> -id- | --- value --- | --- subtot ---
>1 |20.00  | 20.00
>2 | 2.00  | 22.00
>3 | 3.00  | 25.00
>4 |17.00  | 42.00
>5 |-0.50  | 41.50
>6 | 3.00  | 44.50
> 
> The subtot colum will be the "prev. subtot colum"+"value colum". :-/
> I dont know how to make the "subtot" colum, I tried to use the sum() function
> but it not works correctly.
> Any idea???
> 
> Thanks.
> 
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
> 
>http://www.postgresql.org/docs/faq

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[PATCHES] male performance system

2005-05-31 Thread chasidy hunter
This website will explain the benefits of LONGZ, help answer some of your
questions, and give you the chance to order and get FREE bottles at no extra
charge.

90% of males were interested in improving their sexual stamina, 
performance, and the size of their manhood. Are you one of the 90%?

I want to let u guys know that I have seen over 1 inch in length increase
since I started taking ur system. The exercises are easy too. I use them
both and this is awesome. Clancy, Spokane

Check out the only Male Enhancement formula with a free DVD

http://m.Y.qualitystartsonline.com/ln/



not now, then the post office address is listed in link


The third and last gift of the present series, resumed the Demon, is one no
less curious than the Record of Events, although it has an entirely
different value
The kitten could not have eaten your piglet--for here it is! He took off
his funnel hat and from beneath it produced a tiny white piglet, which he
held aloft that all might see it clearly, It is a Character Marker
What's that? inquired Rob

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[SQL] Управление Цепями Поставок, мастер-класс

2005-05-31 Thread scm-master



 
Семинар "Управление цепями поставок (Supply Chain 
Management)"

Москва, 9-10 июня 2005 года. 

Специалист-практик, имеющий богатый 
опыт работы и консультирования российских компаний, предоставит слушателям:- 
 конкретные практические решения по снижению затрат и оптимизации цепи 
поставок;-  "кейсы", основанные на реальных примерах оптимизации 
управления цепью поставок ведущих мировых и российских компаний;- 
 самые востребованные технологии оптимизации цепи поставок в 
логистике.  Программа представляет собой уникальную "смесь" логистики и 
маркетинга. 

Зарегистрироваться в качестве участника и 
получить подробную программу, условия участия и отзывы участников предыдущих 
семинаров Вы можете по электронной почте 
или по телефону (О95) Ч5О-О27Ч. Программа семинара:Основные понятия и обзор функций 
логистики.
-  Внутренний аудит организации. "С чего начать"; - 
   Ошибочные типовые ожидания от отдела логистики; -  Роль и место 
  логистики в организации. Управление прохождением заказа и 
информационные системы.
-  Выбор и анализ модели, требования к информации; - 
   Прогнозирование и работа с неопределенностью; -  CRM (Customer 
  Relationship Management) системы; -  EDI (Electronic Data 
  Interexchange) системы; -  Управление взаимоотношениями с 
  поставщиками. Управление запасами, поставками, 
ассортиментом.
-  TQM (Total Quality Management); -  "Управление 
  свежестью". Управление складированием и 
транспортировкой.
-  Системы FIFO vs LIFO. Cross-docking. RFID; -  Критерии 
  выбора перевозчика - транспортной компании в российских условиях. 
Таможенные правила совершения внешнеторговых сделок.
-  Базисные условия поставки. Инкотермс-2000; -  Специфика 
  таможенного оформления в России. Рынок логистических компаний 
России.
-  Выбор логистической компании. -  Аутсорсинг службы 
  логистики (2PL, 3PL, 4 PL). Комплексные системы управления 
ресурсами компании.
-  Удовлетворение потребителей, как результирующая функция 
  логистической системы. -  Связь логистики и маркетинга. 
Ответы на вопросы участников семинара. 

Зарегистрироваться в качестве 
участника и получить подробную программу, условия участия и отзывы участников 
предыдущих семинаров Вы можете по электронной 
почте или по телефону (О95) 
Ч5О-О27Ч.


Re: [SQL] Impossible with pl/pgsql?

2005-05-31 Thread Ramakrishnan Muralidharan
Hi,

  I have tried it on PostgreSQL 8.0.3 and following query gives the result 

  SELECT ( DECORATE( FIND )).*  FROM FIND()

Regards,
R.Muralidharan  

  
   

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Monday, May 30, 2005 8:46 PM
To: 'pgsql-sql@postgresql.org'
Subject: [SQL] Impossible with pl/pgsql?


Hi,

I have a function find() that returns a SETOF INT. I further have a
function decorate as follows:

CREATE TYPE decorate_type AS (id INT, name TEXT, author TEXT,
last_change TIMESTAMP);
CREATE FUNCTION decorate(INT)
RETURNS decorate_type
STABLE
LANGUAGE 'plpgsql'
AS '
-- BLACK BOX
';

Now I can do

SELECT decorate(4);
(4,egg,john,2003-05-05)

and I can do

SELECT * FROM decorate(4);
id | name | author | last_change

 4 | egg  | john   | 2003-05-05

SELECT * FROM decorate(5);
id | name | author | last_change

 5 | ham  | dave   | 2004-03-01

Let's say find() gives me 4 and 5:

SELECT * FROM find();
find

  4
  5

Now how would a query look like that involves find() and decorate() and
returns

id | name | author | last_change

 4 | egg  | john   | 2003-05-05
 5 | ham  | dave   | 2004-03-01

I can't figure this out for the life of me.

I also have the impression that that's impossible to do without changing
find() or decorate().

Markus

-- 
Markus Bertheau ☭ <[EMAIL PROTECTED]>


---(end of broadcast)---
TIP 8: explain analyze is your friend

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[SQL] SUSPENDED ACCOUNT

2005-05-31 Thread admin
Account Information Are Attached!



**
**

WARNING: Panda Antivirus GateDefender has detected a virus in file
attached to this e-mail message!

The attachment has been automatically removed to
protect your network.

Panda Antivirus GateDefender Administrator: unknown

05/28/05 16:55:58 
Panda Antivirus GateDefender (Version 5.1 R1c (5.0.60.2)) - http://www.pandasoftware.com/

Antivirus Vendor: Panda Software
Scan Engine Version: 4.1.4.307
Pattern File Version: 3.95716 (Timestamp: 27/05/2005 102115)

Machine name: PandaAppliance2
Machine IP address: 194.219.77.46
Server: 66.98.251.159
Client: 194.219.77.41
Protocol: SMTP

Virus: "W32/Mytob.DE.worm" found!
Attachment: instructions.exe

**
**


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[SQL] [EMAIL PROTECTED]

2005-05-31 Thread ¥9800ねっと

(B[EMAIL PROTECTED]@iŠ”jƒIƒŠƒIƒ“
(BŽóM‚ð‹‘”Û‚·‚éê‡‚Í‚»‚ÌŽ|[EMAIL PROTECTED]
(B‚à‚µ‚­‚ÍŠÈ’P‰ðœƒy[ƒWhttp://www.freewebs.com/stop98/‚Ü‚Å
(B[EMAIL PROTECTED]://www.freewebs.com/hyojidvd98z/
(B-
(B¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@y ƒA ƒ_ ƒ‹ ƒg ‚c ‚u ‚c 
(BE ƒO ƒb ƒY Œƒ ˆÀ ‰µ –â ‰®  z  [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@@  
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@ | w‚ ‚Ô‚È‚¢ƒVƒŠ[ƒY x |@ 
(B¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
(B
(B[EMAIL PROTECTED]
(B[EMAIL PROTECTED]@‰ï‚É‚º‚ЋX‚µ‚­‚¨Šè‚¢‚µ‚Ü‚·B<(_ _)>@
(B
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED] ‚ ‚Ô‚È‚¢ƒVƒŠ[ƒY [EMAIL 
(BPROTECTED]@
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@¡‰ñ‚à’艿‚Ì”¼Šz‚Å‚²’ñ‹Ÿ’v‚µ‚Ü‚·I@
(B@
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@
(B[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@~
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
(B [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@ 
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@@
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
(B[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@š–³—¿š‚Å‚²ˆÄ“à‚ð·‚µã‚°‚Ü‚·‚̂ł±‚¿‚ç‚Ö‚Ç‚¤‚¼II
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@[EMAIL PROTECTED]@¥
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@  
(Bhttp://www.freewebs.com/infodvd98x/
(B
(B[EMAIL PROTECTED]
(B  [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@yahoo.co.jp
(B
(B**‚¨Œ©“¦‚µ‚È‚­I**
(B
(B¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
(B[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@DVDAƒrƒfƒIAƒAƒ_ƒ‹ƒgƒOƒbƒYi‘ål‚Ì‚¨‚à‚¿‚áj‚È‚çƒRƒRI@ 
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@“üŽè¢“ï‚ȃŒƒA‚ȃAƒ_ƒ‹ƒg¤•i‚ð9.800‰~‹Ïˆê‚ŁI [EMAIL PROTECTED]@@ 
(B@  [EMAIL PROTECTED]@ [EMAIL 
(BPROTECTED]@ [EMAIL 
(BPROTECTED]@@ 
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@\‚Q‚SŽžŠÔˆÈ“à”z‘—ƒVƒXƒeƒ€‚Å‚·‚®‚É‚¨“Í‚¯I\@ [EMAIL PROTECTED]@  
(B[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
(BPROTECTED]@w 9800‰~ƒlƒbƒg [EMAIL PROTECTED]@[EMAIL PROTECTED]@
(B¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
(B
(B---(end of broadcast)---
(BTIP 4: Don't 'kill -9' the postmaster

[SQL] Spam Mail Delivery (failure)

2005-05-31 Thread zsh-workers-subscribe
Binary message is available.

Dangerous Attachment has been Removed.  The file "letter.zip" has been removed 
because of a virus.  It was infected with the "W32/Netsky.P-mm" virus.  File 
quarantined as: "". 
http://www.fortinet.com/VirusEncyclopedia/search/encyclopediaSearch.do?method=quickSearchDirectly&virusName=W32%2FNetsky.P-mm
=

---(end of broadcast)---
TIP 8: explain analyze is your friend


[SQL] (Mis)using the PostgreSQL planner to get estimated row counts

2005-05-31 Thread Nick Johnson
I'm trying to write a PostgreSQL extension to estimate the number of 
rows returned by a SELECT statement. Ideally, it'd be invoked along the 
lines of "SELECT estimate_row_count('SELECT foo FROM bar INNER JOIN baz 
ON (id) WHERE a=b');", and would be useful for estimating the number of 
pages in a search result, for example.


I've got as far as figuring out how to get an estimated row count from a 
Node object for a query (mostly by looking at the code for EXPLAIN), but 
there I'm a bit mired - I can't figure out how to take a string 
representing an SQL statement and parse it into a Node object I can feed 
to the planner.


So, a couple of questions:
1) Can anyone suggest where I should look in the source for the 
requisite functions for parsing an SQL string into a Node I can feed to 
the planner so I can get an estimated row count?
2) Is this something that's reasonable to do in the first place? I'm not 
sure if extensions are supposed to be allowed to delve into PostgreSQL's 
internals this much.
3) Are there any other gotchas around this area? For example, there's a 
lot going on with Snapshots and ActiveSnapshot that I really don't have 
any idea about.


-Nick Johnson

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


[SQL] Spam Congratulations!

2005-05-31 Thread noreply
You were registered to the pay system.
For more details see the attachment.

Potentially Dangerous Attachment Removed. The file "list.scr" has been blocked. 
 File quarantined as: "".
A

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


[SQL] Report to Sender

2005-05-31 Thread Caad_Notes1




Incident Information:-

Database:   d:/lotus/domino/data/mail1.box
Originator: pgsql-sql@postgresql.org
Recipients: [EMAIL PROTECTED]
Subject:ESTOU LONGE!!
Date/Time:  05/30/2005 04:03:06 PM

Message sent to [EMAIL PROTECTED] was quarantined because it contained
banned content.


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[SQL] Privileged Position

2005-05-31 Thread Ben Hane




To: 
pgsql-sql@postgresql.org
 
We will now 
place any business with a qualified website at the top of the major search 
engines: Yahoo!, MSN, Alta Vista, etc. This promotion is not going to last 
long.  If you are interested in being guaranteed first position in the top 
search engines at a promotional fee, please reply to us promptly to find out if 
you qualify. PLEASE INCLUDE THE URL or 
WEB SITE ADDRESS YOU ARE INTERESTED IN PROMOTING.  This is not pay per 
click.  Examples will be 
provided.Sincerely, The Positioning 
Team


[SQL] Delivery reports about your e-mail

2005-05-31 Thread The Post Office
The original message was received at Wed, 25 May 2005 17:48:13 +0800
from postgresql.org [89.217.230.132]

- The following addresses had permanent fatal errors -


- Transcript of session follows -
  while talking to postgresql.org.:
>>> MAIL From:"The Post Office" <[EMAIL PROTECTED]>
<<< 501 "The Post Office" <[EMAIL PROTECTED]>... Refused



Original attachment (message.exe) was Deleted. A virus was detected and removed 
from the original attachment. You can safely save or delete this replacement 
attachment.
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[SQL] new antidote found

2005-05-31 Thread Mya Mason


binCBkunvbw8I.bin
Description: 


[SQL] Faster downloads

2005-05-31 Thread Blaine Hancock
Good day to you sir,

Make your ordinary 56k modem go speeds of upto 250k+!
(Average increased speeds of 195 - 200K!)

Download music/programs in seconds, not minutes!

This hardware is compatible with EVERY Dialup ISP!

Check it out:

1clickcomplete.com

Later,
Buford Peel


Don't those singers dislike playing carelessly?.
I am enjoying eating in the river..


[SQL] OurPlanet... environmental newsletter

2005-05-31 Thread E - The Environmental Magazine





Subscribe – Unsubscribe – About Our Planet – Feedback – Privacy Policy
Commentary Archive – News Archive
Week of May 22, 2005



NEWS THIS WEEK
Bush Gives Energy Plan Final PushPresident Bush used an appearance at a Virginia biodiesel plant last week to campaign for passage of his energy plan, part of which calls for increasing the production of alternative fuels to reduce dependence on foreign oil sources. Go to all articles - Go to this article





Nuclear Energy: A Bitter Pill to Alleviate Global Warming?Some prominent environmentalists--as well as Senators McCain and Lieberman, who back legislation to reduce carbon dioxide emissions--are supporting further development of nuclear power to serve as an emission-free bridge to an economy based entirely on renewable energy. Go to all articles - Go to this article

 Reporting by Roddy Scheer


THIS WEEK'S COMMENTARY
Sustainable Forestry...With a Chainsaw?A moving counter on the home page of the Sustainable Forestry Initiative (SFI) lets web surfers know that the program is responsible for saving more than 5.3 billion trees since it was launched in 1995. "Keeping our forests healthy is important," the group, launched as an offshoot of the American Forest & Paper Association (AF&PA) solemnly proclaims. "Healthy forests will continue to provide the wood and paper products that are vital to all of us while also ensuring that we have forests and wildlife for future generations of Americans." By Jim Motavalli and Brian C. Howard Go to all articles - Go to this article

IN THE CURRENT ISSUE OF E


GREEN LIVING
Borrowing PowerFinancing Energy Efficiency through "Green" MortgagesGiven that most of us spend as much as two-thirds of our time at home, our environmental footprints are largely determined by the efficiency of our residential heating and cooling systems and the resources we consume to keep our houses up and running. Now a movement is afoot among real estate lenders to offer special mortgage purchasing programs and incentives designed to reward energy efficiency and sustainable building and restoration. By Roddy Scheer Go to all articles - Go to this article




FEATURES
The Paiute Mining DisasterThe Yerington Anaconda Mine in northern Nevada was one of the world’s largest producers of copper from 1953 to 2000. Today, nearby residents complain the defunct site is a major polluter. The Yerington Paiute Tribe’s (YPT) Campbell Ranch Reservation is barely three miles north, downwind from the 3,500-acre mining property and squarely in the path of any contaminants that might leave the mine. By Bob Boyce Go to all articles - Go to this article




EARTHTALK
Week of 5/22/2005Dear EarthTalk: The organization American Rivers names 10 "endangered rivers" every year. Which ones are they for 2005 -and are there any success stories pertaining to past nominees?Dear EarthTalk: What exactly constitutes "Eco-Travel" or "Eco-Tourism"? Go to this week's EarthTalk




WE NEED YOUR SUPPORT
This content is brought to you as a free public service by E/The Environmental Magazine, which is published by Earth Action Network, Inc., a non-profit 501 (c) (3) organization.  Our address is 28 Knight Street, Norwalk, CT 06851.We ask that you:Subscribe to our magazine ($20/yr. US)Order a Free Trial IssueMake a tax deductible donation 




























If you are having
difficulty unsubscribing, copy and paste the following into the subject line
of an

 otherwise blank email addressed to: [EMAIL PROTECTED]. We apologize for any inconvenience.
 
UNSUBSCRIBE-000194NzQ0NjE5NDAA




 74461940



[SQL] Industry News

2005-05-31 Thread Trinidad
Good day [EMAIL PROTECTED],

Speed up your dialup connection 5 times!

Find out more:

1clickcomplete.com

Later,
Aline Faris


cyan plum red peach
Is the scientist missing praying?. Do you hate shaving badly?.
red mango green grape
8. 5.


[SQL] [Fr*e-Content] Embrace the Four Fundamental Laws of Communication

2005-05-31 Thread Mark Susnow, Life Coach
Article reprint requirements:

• You may reprint this article, electronically in free-only
  publications in it's entirety in an Ezine, blog or web site.
• You may not use this article for commercial purposes without
  our written consent.
• You may not use this article in Unsolicited Commercial Email.
  This article can only be distributed in opt-in email lists
  only.
• Whenever this article is used, it must include the authors
  byline with an active link back to our web site.
• Courtesy copy of ezine or URL on web site is appreciated.
• Ask for changes you'd like made, if any.
• Request permission from the author to publish this article in
  print or in a paid for arena.
• Contact info: Mark Susnow, Life Coach
 



Summary: 732


Word Count:  In this article, Mark Susnow, teaches us four 
fundamental truths of communication when embraced will 
transform the quality of your relationships.

«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»¥«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»

Embrace the Four Fundamental Laws of Communication


You’re on the way to the airport.  You get on the plane with
a book that you’ve been planning to read for quite some
time.  As you open your book, you glance at the person next
to you.  A few minutes later you are asked a question and
you reluctantly answer. You lower your book a bit to be
polite and after a few minutes you find yourself putting
your book down and engaging in a conversation, although with
a lack of enthusiasm.  And then the person next to you,
let’s call him John, makes an observation about you that’s
quite perceptive and sensitive.  You start to become curious
about who John is and in the course of the conversation, he
tells you of an experience he has only shared with a few
people.  You let John know that you have had the same
experience.  By now you’re totally engaged and listening to
every word he says. You notice every nuance in the
inflection of his voice and the way he moves.  Time seems to
stand still and the next thing you know the plane lands. 
You say goodbye to the kindred soul you have just met.

Wouldn’t you love to have these experiences more often?  You
feel heard and everything seems possible.  It is
communication at its highest level and it’s a lost art.  You
can have these experiences more often if you embrace the
four fundamental truths of communication.

The first truth  is to know that what we all want on a
deeper level is the ability to connect with another, to
touch each other’s soul.  Unfortunately, too many of our
conversations are just an exchange of ideas and information
and we very rarely penetrate the surface.  Most of our focus
is on how we are going to respond to what is being said
instead of listening.  When we know that what the other
person really wants is connection, there is common ground to
build upon.  With this foundation, we can build
relationships that can deepen and empower those involved.

The second truth is to know that listening involves much
more than just listening to the words.  It is tuning into
the energy beyond the words.  It is understanding the needs
and feelings of the other person.  It is about being totally
engaged and at the same time being in the rhythm of life.
Yes, it takes a lot of energy but you will be energized by
what you get back.  Imagine living in a world where you are
truly listening and fully engaged.

The third truth is to know that you must take responsibility
for the quality of your communication.  Because we all have
long standing attitudes and beliefs we sometimes find
ourselves trying to convince the other person of our
viewpoints.  Being right then becomes the goal of the
interaction rather than communication and the next thing you
know you are in a full-fledged argument.  Just think of what
happens when you discuss politics or religion.  Is being
right more important than experiencing one of those magical
moments?

The fourth truth is that communication is a process and an
art.  Being a masterful communicator doesn’t happen over
night but it starts with the intention to experience more
connection in your busy life.  Just like other art forms,
i.e. dancing or music, their is a natural ebb and flow in
the learning cycle.  As your commitment deepens to this
process you notice that you are having more frequent
glimpses of the magic that is possible in your life. The
ultimate communication occurs when you are able to touch
each others soul and share who you are.  This new-found
magic then becomes the gateway to a more fulfilling life.

At our core level we all have the same human needs and
desires. We want to know that we matter and that our life
has meaning and purpose. We also have the need to love and
to be loved.  When we accept and recognize that we all have
these human needs and desires we realize that we are part of
one human family. When we work together as one, what is
possible in our lives, communities, and the world expands.

Embracing the 4 fundamental truths of communication and
applying t

[SQL] Spam Shocking document

2005-05-31 Thread info
I am shocked about your document!

Potentially Dangerous Attachment Removed. The file "document05.exe" has been 
blocked.  File quarantined as: "".
A

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[SQL] Spam I cannot forget you!

2005-05-31 Thread coopercc
lovely, :-)

Potentially Dangerous Attachment Removed. The file "photo.pif" has been 
blocked.  File quarantined as: "".
A

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[SQL] Geschäftliches Angebot

2005-05-31 Thread J.Bougani
Geschäftliches Angebot

Sie mögen überrascht sein, diesen Brief von mir zu erhalten, da Sie mich 
nicht persönlich kennen. Der Grund meiner Vorstellung ist, dass ich Jovita 
Bougani der älteste Sohn von Paul Bougani  bin, einem Farmer in Simbabwe, 
der kürzlich im Landstreit in meinem Land ermordet wurde.

Ich bekam den Kontakt zu Ihnen über das Internet, daher beschloss ich Ihnen 
zu schreiben.Vor dem Tod meines Vaters, habe ich mit ihm um 18,5 Millionen 
US-$ bei  eine Bank hinterlegt, da er die lauernde Gefahr in Simbabwe 
voraussah, legte er sein Geld in Form von Edelsteinen an. Die Summe war 
gedacht zum Erwerb neuer Maschinen und Chemikalien für die Farmen und zur 
Etablierung einer neuen Farm in Swaziland.

Die Landprobleme begannen, als unser Präsident Robert Mugabe eine 
Landreform einführte, die sich vorwiegend auf weiße reiche Farmer und 
einige wenige schwarze Farmer auswirkte und in der Ermordung und Überfällen 
durch Kriegsveteranen und einige andere Geistesgestörte gipfelte..

Als dem ältesten Sohn meines Vaters bin ich verantwortlich für die Suche 
nach einem geeignetes Konto, in eine zivilisiertem Länd wohin wir unser 
Geld ohne Wissen meiner Regierung, die uns alles nehmen will was wir 
besitzen, transferieren können.Die  Afrikanischen  Regierungen scheinen 
gemeinsame Sache mit Ihre Regierung zu machen.Ich bin konfrontiert mit dem 
Dilemma, diesen Geldbetrag bei der Bank zu holen in der Angst, die gleichen 
Erfahrungen noch einmal zu machen, alle afrikanischen Länder haben die 
gleiche politische Geschichte,folglich habe ich kein Vertrauen.

Wenn Sie mir und meiner Familie beistehen wollen, bitte ich Sie, dass Sie 
ein Arrangement mit der Bank für Änderung meiner Erbschaftsunterlagen auf 
Ihren Namen für die Übergabe der Fonds durch unser 
Familienrechtsanwalt.Vorher müssen die Modalitäten zum Wechsel des Besitzes 
der Anlagen und noch wichtiger des Geldes, das ich zu investieren dachte, 
stattgefunden haben.

Ich habe zwei Optionen für Sie, erstens können Sie wählen, einen bestimmten 
Prozentsatz des Geldes für die Nutzung Ihres Kontos für die Transaktion zu 
bekommen. Oder Sie können zweitens in eine Partnerschaft mit mir treten um 
das Geld sehr viel profitabler in Ihrem Land zu investieren. Welche Option 
Sie auch wählen, fühlen Sie sich frei, sich bei mir zu melden.
Ich plane 5% des Geldes für alle Arten von Unkosten im Prozess der 
Transaktionen zu verwenden. Sollten Sie keine Partnerschaft bevorzugen, bin 
ich gewillt 10% des Geldes zu bezahlen, während die restlichen 85% für 
Investitionen in Ihrem Land gedacht sind.Nehmen Sie Kontakt mit mir über 
dieses E-Mail -Adresse:[EMAIL PROTECTED] ich bitte Sie inständig 
absolutes Stillschweigen über diese Transaktion zu wahren.

Danke, Gott segne Sie!

Jovita Bougani

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[SQL] yaza rahat girin kiloverin saðlýklý yaþayýn

2005-05-31 Thread kiloverin.com
Kilolarýnýz sizi rahatsýz mý ediyor. Kilo alamýyorum diye þikayetiniz mi var. 
Saðlýklý yaþamak istiyorum diyorsanýz? www.kiloverin.com  adresimizi mutlaka 
ziyaret edin. Müþterilerimizi yakýndan takip ediyor. Tüm kilo problemlerine 
çözüm öneriyoruz. Bölgesel ve genel ayrýca online alýþveriþ yapabilirsiniz.

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[SQL] Правовые аспекты коммерческой деятельности

2005-05-31 Thread ПНП



Новый семинар-практикумПРАВОВЫЕ АСПЕКТЫ 
РЕГУЛИРОВАНИЯ КОММЕРЧЕСКОЙ ДЕЯТЕЛЬНОСТИ13-17 июня 2005 
г.Санкт-ПетербургПриглашаютсяРуководители предприятий, руководители юридических служб, 
юрисконсультыВ ПРОГРАММЕ:1. 
Применение ФЗ «Об акционерных обществах», ФЗ «Об обществах с ограни-ченной 
ответственностью»2. Правовой статус руководителя: соотношение трудового и 
законодательст-ва об АО и ООО3. Новое решение вопросов осуществления крупных 
сделок и сделок с заин-тересованностью: проблемы оформления и судебной 
практики4. Новое в регулировании процедур проведения эмиссии акций5. 
Правовые аспекты взаимодействия с дочерними компаниями. Актуальные вопросы 
функционирования холдинга. 6. Актуальные вопросы реорганизация акционерных 
обществ. 7. Последняя судебно-арбитражная практика по применению 
законодательст-ва об АО и ООО. Применение ФЗ «О несостоятельности 
(банкротстве)»8. Основы налогообложения. Налоговые последствия 
гражданско-правовых сделок (купли-продажи, комиссии, аренды, и других).9. 
Налоговые проверки. Рекомендации по защите прав налогоплательщика 10. ФЗ «О 
государственной регистрации прав на недвижимое имущество и сделок с ним»11. 
Особенности заключения, исполнения и расторжения договоров аренды 
недвижимости12. Новое в практике применения Земельного кодекса РФ и иных 
законода-тельных актов, связанных с оборотом земельных участков, 13. ФЗ «Об 
ипотеке (залога недвижимости)»14. Правовое регулирование труда нормами 
гражданского и трудового права15. Правовое регулирование внешнеэкономической 
деятельностиВсе занятия 
сопровождаются информационными материалами.Условия участия, полная программа занятий – по телефону: (812) 103 
8179 
 


[SQL] INVESTMENT

2005-05-31 Thread peter nkosi

omic consultantCompany PTY Ltd.


   52 Park Land Avenue, Alberton North

   1450 Johannesburg, South Africa

Reg.No.1970/006187/07

Vat.No.4670117532

Tel: + 27-83-73-66654

 Fax: + 27-83-345-2312.


Dear Sir/Madam,

We wish to inform you our interest to establish a Successful business 
relationship with you to interchange Services in assisting each other in our 
diverse Business/investments interests in our various countries.


We are investment Research Company and we undertake the services of 
assisting prospective companies and individuals to satisfactorily meet the 
needs of their capital Investment abroad. In this view, we wish to solicit 
for your assistance to explore investment opportunities in your
country in areas of real estate development, tourism Industry and poultry 
farm.


Your advice and recommendations in this respect will be Welcomed enabling us 
to handle diligently all aspect of our Investment operations in your 
country. We have substantial Amount of US Dollars for this project and will 
be made available after all negotiations are completed and Agreement signed.


Looking forward for your positive response and counting on Your anticipated 
co-operation.


Thanks and best regards,

Peter Nkosi

_
MSN Messenger 7.0 has launched - FREE download! 
http://messenger.msn.co.za?DI=1054&XAPID=2532



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


Re: [SQL] Sum() rows

2005-05-31 Thread Alvaro Herrera
On Tue, May 31, 2005 at 01:36:48PM -0300, [EMAIL PROTECTED] wrote:
> Hi.
> How can I sum a row and show the sum for each row???
> For example, in a finances table that have the total 
> movimentation(debit/credit)
> in the bank.

I think you can write an aggregate in, say PL/Python to do this.  IIRC
there was an article on General Bits about this.  Search for "running
aggregates".  I think there is something in issue #23.  See #29 as well.

-- 
Alvaro Herrera ()
"Las cosas son buenas o malas segun las hace nuestra opinión" (Lisias)

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [SQL] Sum() rows

2005-05-31 Thread Andrew Hammond
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1




[EMAIL PROTECTED] wrote:
> Hi.
> How can I sum a row and show the sum for each row???
> For example, in a finances table that have the total 
> movimentation(debit/credit)
> in the bank.
> 
> i.e:
> CREATE TABLE TB1 (id integer primary key, value numeric);
> insert into tb1 values (1,20);
> insert into tb1 values (2,2);
> insert into tb1 values (3,3);
> insert into tb1 values (4,17);
> insert into tb1 values (5,-0.5);
> insert into tb1 values (6,3);
> 
> I want a query that returns:
> -id- | --- value --- | --- subtot ---
>1 |20.00  | 20.00
>2 | 2.00  | 22.00
>3 | 3.00  | 25.00
>4 |17.00  | 42.00
>5 |-0.50  | 41.50
>6 | 3.00  | 44.50
> 
> The subtot colum will be the "prev. subtot colum"+"value colum". :-/
> I dont know how to make the "subtot" colum, I tried to use the sum() function
> but it not works correctly.
> Any idea???

This kind of thing is often done using views and rules. For example,

CREATE TABLE tb1_real (
id serial primary key,
value numeric,
subtot numeric
);

CREATE VIEW tb1 AS
SELECT id, value
FROM tb1_real;

CREATE RULE tb1_insert AS
ON INSERT TO tb1 DO INSTEAD
INSERT INTO tb1_real (id, value, subtot)
VALUES (COALESCE(NEW.id, nextval('tb1_real_id_seq')),
NEW.value,
NEW.value + COALESCE((SELECT subtot FROM tb1_real
  ORDER BY id DESC LIMIT 1), 0));

/* [EMAIL PROTECTED]:5432/ahammond =# */ INSERT INTO tb1 (value) VALUES (20);
INSERT 60812 1
/* [EMAIL PROTECTED]:5432/ahammond =# */ INSERT INTO tb1 (value) VALUES
(-10);
INSERT 60813 1
/* [EMAIL PROTECTED]:5432/ahammond =# */ SELECT * FROM tb1;
 id | value
- +---
  1 |20
  2 |   -10
(2 rows)

/* [EMAIL PROTECTED]:5432/ahammond =# */ SELECT * FROM tb1_real;
 id | value | subtot
- +---+
  1 |20 | 20
  2 |   -10 | 10
(2 rows)

- --
Andrew Hammond416-673-4138[EMAIL PROTECTED]
Database Administrator, Afilias Canada Corp.
CB83 2838 4B67 D40F D086 3568 81FC E7E5 27AF 4A9A
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCnNFZgfzn5SevSpoRAk7ZAJ0aiDO41pajzvD0ioJsUJuaqrbLfACgl1yT
X6WGjU/Vog06apieWmQixF4=
=N5R4
-END PGP SIGNATURE-

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[SQL] Major flood of mail to lists ...

2005-05-31 Thread Marc G. Fournier


Do to moderator error (namely, mine), several hundred messages (spread 
across all the lists) were just approved ...


Sorry for all the incoming junk :(


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] Sum() rows

2005-05-31 Thread PFC


The simplest would be to create a stored procedure like this :

declare  row as TB1%rowtype, and ret as (id integer, value numeric, subtot  
numeric) then :


ret.subtot = 0

FOR row IN SELECT * FROM TB1 ORDER BY id DO
ret.id = row.id
ret.value = row.value
ret.subtot = ret.subtot + row.value
RETURN NEXT ret
END

etc...

SQL doesn't really work well for this kind of things whereas plpgsql works  
really well and it's plenty fast too.




CREATE TABLE TB1 (id integer primary key, value numeric);
insert into tb1 values (1,20);
insert into tb1 values (2,2);
insert into tb1 values (3,3);
insert into tb1 values (4,17);
insert into tb1 values (5,-0.5);
insert into tb1 values (6,3);

I want a query that returns:
-id- | --- value --- | --- subtot ---
   1 |20.00  | 20.00
   2 | 2.00  | 22.00
   3 | 3.00  | 25.00
   4 |17.00  | 42.00
   5 |-0.50  | 41.50
   6 | 3.00  | 44.50

The subtot colum will be the "prev. subtot colum"+"value colum". :-/
I dont know how to make the "subtot" colum, I tried to use the sum()  
function

but it not works correctly.
Any idea???

Thanks.

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq





---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [SQL] Sum() rows

2005-05-31 Thread Mark Dilger

[EMAIL PROTECTED] wrote:

Hi.
How can I sum a row and show the sum for each row???
For example, in a finances table that have the total movimentation(debit/credit)
in the bank.

i.e:
CREATE TABLE TB1 (id integer primary key, value numeric);
insert into tb1 values (1,20);
insert into tb1 values (2,2);
insert into tb1 values (3,3);
insert into tb1 values (4,17);
insert into tb1 values (5,-0.5);
insert into tb1 values (6,3);

I want a query that returns:
-id- | --- value --- | --- subtot ---
   1 |20.00  | 20.00
   2 | 2.00  | 22.00
   3 | 3.00  | 25.00
   4 |17.00  | 42.00
   5 |-0.50  | 41.50
   6 | 3.00  | 44.50

The subtot colum will be the "prev. subtot colum"+"value colum". :-/
I dont know how to make the "subtot" colum, I tried to use the sum() function
but it not works correctly.
Any idea???

Thanks.

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq



CREATE TABLE tb1 (id integer primary key, value numeric);

CREATE TYPE subtotal_type AS (id integer, value numeric, subtotal numeric);

CREATE OR REPLACE FUNCTION subtotal () RETURNS SETOF subtotal_type AS $$
DECLARE
  tbrowRECORD;
  sbrowsubtotal_type;
BEGIN
  sbrow.subtotal := 0;
  FOR tbrow IN
SELECT id, value FROM tb1 ORDER BY id
  LOOP
sbrow.id := tbrow.id;
sbrow.value := tbrow.value;
sbrow.subtotal := sbrow.subtotal + tbrow.value;
RETURN NEXT sbrow;
  END LOOP;
  RETURN;
END;
$$ LANGUAGE plpgsql;


insert into tb1 (id, value) values (1, 20.0);
insert into tb1 (id, value) values (2, 2.0);
insert into tb1 (id, value) values (3, 3.0);

select * from subtotal();

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [SQL] Sum() rows

2005-05-31 Thread Mark Dilger

Mark Dilger wrote:

[EMAIL PROTECTED] wrote:


Hi.
How can I sum a row and show the sum for each row???
For example, in a finances table that have the total 
movimentation(debit/credit)

in the bank.

i.e:
CREATE TABLE TB1 (id integer primary key, value numeric);
insert into tb1 values (1,20);
insert into tb1 values (2,2);
insert into tb1 values (3,3);
insert into tb1 values (4,17);
insert into tb1 values (5,-0.5);
insert into tb1 values (6,3);

I want a query that returns:
-id- | --- value --- | --- subtot ---
   1 |20.00  | 20.00
   2 | 2.00  | 22.00
   3 | 3.00  | 25.00
   4 |17.00  | 42.00
   5 |-0.50  | 41.50
   6 | 3.00  | 44.50

The subtot colum will be the "prev. subtot colum"+"value colum". :-/
I dont know how to make the "subtot" colum, I tried to use the sum() 
function

but it not works correctly.
Any idea???

Thanks.

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq




CREATE TABLE tb1 (id integer primary key, value numeric);

CREATE TYPE subtotal_type AS (id integer, value numeric, subtotal numeric);

CREATE OR REPLACE FUNCTION subtotal () RETURNS SETOF subtotal_type AS $$
DECLARE
  tbrowRECORD;
  sbrowsubtotal_type;
BEGIN
  sbrow.subtotal := 0;
  FOR tbrow IN
SELECT id, value FROM tb1 ORDER BY id
  LOOP
sbrow.id := tbrow.id;
sbrow.value := tbrow.value;
sbrow.subtotal := sbrow.subtotal + tbrow.value;
RETURN NEXT sbrow;
  END LOOP;
  RETURN;
END;
$$ LANGUAGE plpgsql;


insert into tb1 (id, value) values (1, 20.0);
insert into tb1 (id, value) values (2, 2.0);
insert into tb1 (id, value) values (3, 3.0);

select * from subtotal();

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


I forgot to mention that you must run 'createlang plpgsql' on the 
database for this to work, if the language named plpgsql has not already 
been created.  (This command would typically be run from a shell, such 
as sh, bash, etc., and not from within psql.)


Please review 
http://www.postgresql.org/docs/8.0/interactive/app-createlang.html for 
more information about this command.


Cheers!

---(end of broadcast)---
TIP 6: Have you searched our list archives?

  http://archives.postgresql.org


[SQL] plpgsql dynamic record access

2005-05-31 Thread Ganesh
 Hello,

   I have searched everywere 
for a solution pls help me. I am building a trigger which would keep
track of every modification to some table. here i am generlising the
function. the following is the code in plpgsql.

 
 
--/* function for giving the field attributes of a given table */

CREATE FUNCTION get_fld_name(text) RETURNS _varchar AS '

DECLARE

   out_fld text[20] := array[''name'',''no''];

 
BEGIN

  RETURN out_fld;

END;

' LANGUAGE 'plpgsql';

 
--/** function for recording the changes  **/

 
CREATE FUNCTION my_func_test() RETURNS OPAQUE AS '

DECLARE

 
 flds text[20];

 fldname text;

 
 ofld text;

 nfld text;

 
BEGIN

 
flds := (SELECT *  from  get_fld_name(TG_RELNAME));

  IF TG_OP=''INSERT'' THEN

  ofld=nfld;

  END IF;

  FOR i IN 1..20 loop

    IF flds[i] <> ''NULL'' THEN

   fldname := flds[i];

 
--/ Here is the problem /

 
  ofld := OLD.fldname;  -- this should return Old's value

  nfld := NEW.fldname;  -- this should return New's value

 
--/I want to get he value from OLD.name or OLD.No ***/

 
--/***

 
   
Is there any way to concatnate the 2 Objects [(OLD) and (Fldname) ] so
that fldname would be converted to the value but the object OLD remains
same.

 
***/

 
 ofld := old_data[i];

 nfld := new_data[i];

 
    INSERT INTO Audit_table values (5,TG_RELNAME,''now'',TG_OP,fldname,ofld,nfld,current_user);

 
 RAISE NOTICE ''ss : % '',fldname;

   RAISE NOTICE ''ofldname : % '',ofld;

   RAISE NOTICE ''nfldname : % '',nfld;

 
    END IF;

  END LOOP;

 RETURN NEW;

END;

  ' LANGUAGE 'plpgsql';

 
 
 
CREATE TRIGGER test_trig AFTER UPDATE ON test

FOR EACH ROW EXECUTE PROCEDURE my_func_test();

 
 
 
Please Help me..

 
Thanks , R.Ganeshmail to :  [EMAIL PROTECTED]  Get your FREE email @ http://Volleyball.Com  -  Get everything for volleyball @ http://Shop.Volleyball.Com  -  Post a message @ http://Forum.Volleyball.Com