Sending queries directly

Started by Pedro Belminoalmost 18 years ago4 messages
#1Pedro Belmino
pedrobelmino@gmail.com

Hello,
I am creating an agent that runs alongside the postgres written in c++, I
have a question: How send sql queries directly for the database without
going need to make any connection?
What I call function, which I use file?

Thanks,
--
Pedro Belmino.
--------------------------------------------------------------------
# Ciência da Computação - UNIFOR
# pedrobelmino@gmail.com
--------------------------------------------------------------------

#2Heikki Linnakangas
heikki@enterprisedb.com
In reply to: Pedro Belmino (#1)
Re: Sending queries directly

Pedro Belmino wrote:

I am creating an agent that runs alongside the postgres written in c++, I
have a question: How send sql queries directly for the database without
going need to make any connection?

You can't. Why would you not want to open a connection?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Pedro Belmino (#1)
Re: Sending queries directly

Pedro Belmino wrote:

Hello,
I am creating an agent that runs alongside the postgres written in
c++, I have a question: How send sql queries directly for the database
without going need to make any connection?
What I call function, which I use file?

You can't. Why can't you use a connection?

cheers

andrew

#4Chris Browne
cbbrowne@acm.org
In reply to: Pedro Belmino (#1)
Re: Sending queries directly

pedrobelmino@gmail.com ("Pedro Belmino") writes:

I am creating an agent that runs alongside the postgres written in
c++, I have a question: How send sql queries directly for the
database without going need to make any > connection? > What I
call function, which I use file?

You don't do that; your agent should use libpq to establish a
connection just like everyone else.
--
(format nil "~S@~S" "cbbrowne" "cbbrowne.com")
http://cbbrowne.com/info/linux.html
I just removed the instructions in MC:COMMON;LINS > which specify that
it should be installed on AI. We'll certainly miss that machine, and
probably spend the rest of our lives fixing programs that mention it.