libpq prepared statement
libpq prepared statement
- Subject: libpq prepared statement
- From: Justin Giboney <email@hidden>
- Date: Mon, 31 Mar 2008 13:44:34 -0600
I am trying to get a libpq prepared statement to compile (not actually
work) in my app. I am having difficulty finding an example of one on
the internet somewhere. I don't really understand the documentation ( http://www.postgresql.org/docs/8.1/static/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO
) to well, but I thought I would try it before asking.
Here is what I have (it is probably nowhere close)
NSString *theUUID = @"test"; //this works
PGconn *conn = PQconnectdb(conninfo); // this works
PQprepare *statement = PQPrepare(theConnection, "stmtname", "SELECT *
FROM admin WHERE id = %s", 1, [theUUID]);
I get two errors here
1) 'statement' undeclared (first use in this function)
2) syntax error before ']' token
The documentation says that this will be used with the PQexecPrepared,
but I don't understand how.
If you have an example I could look at that would be great.
Thank you,
Justin Giboney
p.s. why is it that Apple has no documentation on having Cocoa work
with Databases? Try typing in "mysql" or "postgresql" in the search
box of this page http://developer.apple.com/cocoa/ while restricting
it to cocoa. Do they not want business to use Cocoa?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden