Re: [INTERFACES] Regarding selction of query

Поиск
Список
Период
Сортировка
От Constantin Teodorescu
Тема Re: [INTERFACES] Regarding selction of query
Дата
Msg-id 37B1883A.47B6D51@flex.ro
обсуждение исходный текст
Ответ на Regarding selction of query  (SUMA R <suma.r@tatainfotech.com>)
Список 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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] libpgtcl and array fields return format - PROPOSAL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [INTERFACES] libpgtcl and array fields return format - PROPOSAL