Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9526E475D20 for ; Mon, 14 Oct 2002 05:14:03 -0400 (EDT) Received: from relay.flex.ro (ns.flex.ro [193.230.255.2]) by postgresql.org (Postfix) with ESMTP id 946244758BD for ; Mon, 14 Oct 2002 05:14:02 -0400 (EDT) Received: from flex.ro (teo.flex.ro [193.230.255.11]) by relay.flex.ro (Postfix) with ESMTP id 5EBDB24F03 for ; Mon, 14 Oct 2002 12:14:03 +0300 (EEST) Message-ID: <3DAA8ADB.6060208@flex.ro> Date: Mon, 14 Oct 2002 12:14:03 +0300 From: Constantin Teodorescu User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PostgreSQL Interfaces Subject: What's wrong in this pltcl function ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/31 X-Sequence-Number: 3193 create function ruldeb(bpchar) returns bpchar as ' set cont $1 set rulaj 0.0 spi_exec -array rec "select valoare from valori where debitor LIKE \'$cont%\'" { set rulaj [expr {$rulaj + $rec(valoare)}] } if {![info exists GD(conturi_lookup)]} { set GD(conturi_lookup) [spi_prepare "select cheie,denumire from conturi where id=\'\\$1\'" [list bpchar]] } spi_execp -count 1 $GD(conturi_lookup) [list $cont] return "{$cheie} {$denumire} $rulaj" ' LANGUAGE 'pltcl'; is giving the following error: ERROR: pltcl: can't read "cheie": no such variable can't read "cheie": no such variable while executing "return "{$cheie} {$denumire} $rulaj"" (procedure "__PLTcl_proc_1759991" line 12) invoked from within "__PLTcl_proc_1759991 4:0:1:1:2:" ------------------ Please, could someone give me a clue? thanks in advance, Constantin Teodorescu Braila, ROMANIA