Received: from flex.flex.ro (IDENT:root@[193.230.255.4]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA04332 for ; Wed, 11 Aug 1999 10:24:57 -0400 (EDT) (envelope-from teo@flex.ro) Received: from flex.ro (IDENT:teo@teo.flex.ro [193.230.255.3]) by flex.flex.ro (8.9.3/8.9.3) with ESMTP id RAA00764; Wed, 11 Aug 1999 17:21:33 +0300 Sender: teo@flex.flex.ro Message-ID: <37B1883A.47B6D51@flex.ro> Date: Wed, 11 Aug 1999 14:27:06 +0000 From: Constantin Teodorescu Organization: FLEX Consulting Braila X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.9 i586) X-Accept-Language: en MIME-Version: 1.0 To: SUMA R CC: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Regarding selction of query References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit SUMA R wrote: > > Hi, > In the pgtclsh shell iam able to connect to the database and exec the > queries what i require, ex inserting, deleting etc. > > How can i use the pg_select? . for ex > > pg_exec connection "select * from emp" > > will get executed , but what will happen to the results of select. > > I want the result of the above query to a string. > Iam new to this postgres set dbc [pg_connect mydatabase] pg_select $dbc "select name,age from people" rec { puts "$rec(name) has $rec(age) years" } or set pgres [pg_exec $dbc "insert into people(name,age) values('teo',36)"] pg_result $pgres -clear -- Constantin Teodorescu FLEX Consulting Braila, ROMANIA