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: | 20040609223530.6435.qmail@web40604.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
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
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(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?
>
>
http://www.postgresql.org/docs/faqs/FAQ.html
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
From | Date | Subject | |
---|---|---|---|
Next Message | David Stanaway | 2004-06-09 22:38:14 | Re: Problem with PQexecPrepared |
Previous Message | Jeroen T. Vermeulen | 2004-06-09 22:21:14 | Re: Problem with PQexecPrepared |