Re: A doubt in pgtcl - Mailing list pgsql-interfaces

From Brett Schwarz
Subject Re: A doubt in pgtcl
Date
Msg-id 20040609223530.6435.qmail@web40604.mail.yahoo.com
Whole thread Raw
In response to A doubt in pgtcl  (Senthil <senthil_j@chain-sys.com>)
List 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
example:

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]"
}


HTH,
   --brett



--- Senthil <senthil_j@chain-sys.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?
> 
>               
http://www.postgresql.org/docs/faqs/FAQ.html


    
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


pgsql-interfaces by date:

Previous
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: Problem with PQexecPrepared
Next
From: David Stanaway
Date:
Subject: Re: Problem with PQexecPrepared