pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Regarding selction of query
2+ messages / 2 participants
[nested] [flat]

* Regarding selction of query
@ 1999-08-11 13:46  SUMA R <suma.r@tatainfotech.com>
  0 siblings, 1 reply; 2+ messages in thread

From: SUMA R @ 1999-08-11 13:46 UTC (permalink / raw)
  To: pgsql-interfaces

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

from suma   





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] Regarding selction of query
@ 1999-08-11 14:27  Constantin Teodorescu <teo@flex.ro>
  parent: SUMA R <suma.r@tatainfotech.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Constantin Teodorescu @ 1999-08-11 14:27 UTC (permalink / raw)
  To: SUMA R <suma.r@tatainfotech.com>; +Cc: pgsql-interfaces

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-08-11 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-08-11 13:46 Regarding selction of query SUMA R <suma.r@tatainfotech.com>
1999-08-11 14:27 ` Constantin Teodorescu <teo@flex.ro>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox