From: Brett Schwarz <brett_schwarz@yahoo.com>
To: Senthil <senthil_j@chain-sys.com>
To: scrappy@hub.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: A doubt in pgtcl
Date: Wed, 9 Jun 2004 15:35:30 -0700 (PDT)
Message-ID: <20040609223530.6435.qmail@web40604.mail.yahoo.com> (raw)
In-Reply-To: <opr87xv1ur4cz2t2@mail.chain-sys.com>
[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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: brett_schwarz@yahoo.com, senthil_j@chain-sys.com, scrappy@hub.org
Subject: Re: A doubt in pgtcl
In-Reply-To: <20040609223530.6435.qmail@web40604.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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