pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
A doubt in pgtcl
2+ messages / 2 participants
[nested] [flat]

* A doubt in pgtcl
@ 2004-06-07 09:56 Senthil <senthil_j@chain-sys.com>
  2004-06-09 22:35 ` Re: A doubt in pgtcl Brett Schwarz <brett_schwarz@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Senthil @ 2004-06-07 09:56 UTC (permalink / raw)
  To: scrappy@hub.org

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




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

* Re: A doubt in pgtcl
  2004-06-07 09:56 A doubt in pgtcl Senthil <senthil_j@chain-sys.com>
@ 2004-06-09 22:35 ` Brett Schwarz <brett_schwarz@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Brett Schwarz @ 2004-06-09 22:35 UTC (permalink / raw)
  To: Senthil <senthil_j@chain-sys.com>; scrappy@hub.org; +Cc: 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/ 



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


end of thread, other threads:[~2004-06-09 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-07 09:56 A doubt in pgtcl Senthil <senthil_j@chain-sys.com>
2004-06-09 22:35 ` Brett Schwarz <brett_schwarz@yahoo.com>

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