Skip site navigation (1) Skip section navigation (2)

Re: A doubt in pgtcl

From: Brett Schwarz <brett_schwarz(at)yahoo(dot)com>
To: Senthil <senthil_j(at)chain-sys(dot)com>, scrappy(at)hub(dot)org
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: A doubt in pgtcl
Date: 2004-06-09 22:35:30
Message-ID: (view raw or whole thread)
Lists: pgsql-interfaces
[Hummmm, wonder why it didn't have pgsql-interfaces in
the reply-to]

You can use pg_result to get any error info. For

set han [pg_connect ...]

set result [pg_exec $han "SELECT * FROM bogus_table"]

set stat [pg_result $result -status]

if {$stat ne "PGRES_TUPLES_OK"} {

    puts "GOT ERROR: [pg_result $result -error]"



--- Senthil <senthil_j(at)chain-sys(dot)com> wrote:
> Dear Sir,
> 	I have just started to program in pgtcl.I have to
> write a procedure for 
> connecting to a table and fetching records and
> inserting them.What should 
> I do to catch the error conditions?The postmaster
> runs in a separate 
> terminal and Tcl in another one.The errors may be
> non existing table 
> name,field name or errors like query fetching many
> rows as result.Please 
> give me a solution for this problem.Thanking you.
> Yours truly,
> Senthil J
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?

Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger. 

In response to

pgsql-interfaces by date

Next:From: David StanawayDate: 2004-06-09 22:38:14
Subject: Re: Problem with PQexecPrepared
Previous:From: Jeroen T. VermeulenDate: 2004-06-09 22:21:14
Subject: Re: Problem with PQexecPrepared

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group